Welcome Guest, Not a member yet? Register   Sign In
jqGrid and CI
#11

[eluser]kikz4life[/eluser]
hi internut.

I am also trying to integrate the jqGrid to CI. previously im using flexigrid and now im trying to work with jqgrid but somehow im stuck. could you post your model here. It would be a great for all of us whose struggling in working with jqgrid.

also i used in my website jquery 1.2.6 but in jqgrid 1.3.2 and now im upgrading my jquery but when i apply the 1.3.2 with jqGrid i encounter an error it says the "E is null". I track the problem using firebug and its in the jquery 1.3.2. Did anyone encounter same situation?

Quote:jQuery('#listFlex').jqGrid
(
{

title: '<?=lang("role_title")?>',
url: root + mod + '/sec_role',
//blockOpacity: 0,
mtype: 'POST',
dataType: 'json',
colNames:['role_code','role_description'],
colModel : [
{name : 'role_code', width : 100, align : 'left', editable:true, editoptions:{size:25}, sortable:true}
,{name : 'role_desc', width : 200, align : 'left', editable:true, editoptions:{size:25}, sortable:true}

],
rowNum:10,
rowList:[10,20,30],
pager: jQuery('#pager2'),
sortname: 'role_code',
viewrecords: true,
sortorder: "desc",
caption:"User Role List" }).navGrid('#pager2',{edit:false,add:false,del:false
}
);

Quote:<table id="listFlex" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager2" class="scroll" style="text-align:center;"></div>
#12

[eluser]Unknown[/eluser]
I just implemented a master detail jqGrid in CI w/ the navigation bar operations add, delete, edit.

one of the biggest problems with CI and jqGrid is the different posting methods, I ended up using uri segments to pass data for advanced events - but manually circumventing the posting logic by overriding the beforeSubmit method seem to work on all of the navigation bar 'form editing' operations, something like

Code:
beforeSubmit: function(postdata, formid){
      postdata["key"] = $("#someInput").value;
      $.post("&lt;?=base_url()?&gt;someUrl/someSaveFunction.php", postdata);
      return [true, "someMessageOnPostingError"];
}

the <code>postdata[<i>"key"</i>] = $("<i>#someInput</i>").value;</code> should be replaced with whatever data you'd like to pass to the controller, this postdata object will already contain the data from the form's record.

the <code>return [true, "<i>someMessageOnPostingError</i>"];</code> completes the server feedback loop and lets the jqGrid know whether the save (really could be an update or insert) was successful.

There were a couple more caveats I ran into, wrote a post about it called 5 Things You Need to Know About Using jqGrid with CodeIgniter




Theme © iAndrew 2016 - Forum software by © MyBB