Welcome Guest, Not a member yet? Register   Sign In
jqGrid and CI
#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("<?=base_url()?>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


Messages In This Thread
jqGrid and CI - by El Forum - 09-23-2008, 04:06 AM
jqGrid and CI - by El Forum - 04-04-2009, 06:58 AM
jqGrid and CI - by El Forum - 06-23-2009, 12:25 PM
jqGrid and CI - by El Forum - 06-25-2009, 04:23 PM
jqGrid and CI - by El Forum - 08-08-2009, 01:06 PM
jqGrid and CI - by El Forum - 08-08-2009, 10:25 PM
jqGrid and CI - by El Forum - 08-08-2009, 11:08 PM
jqGrid and CI - by El Forum - 08-11-2009, 05:43 AM
jqGrid and CI - by El Forum - 08-11-2009, 05:46 AM
jqGrid and CI - by El Forum - 09-24-2009, 06:59 PM
jqGrid and CI - by El Forum - 10-19-2009, 02:42 AM
jqGrid and CI - by El Forum - 12-22-2009, 09:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB