If you want to use this feature in your application with logic different in the one that is provided in the formatter actions, you should write a custom Java Script code.
In this case you can use one of the following PHP methods
setGridEvent
callGridMethod
setJSCode
Below we list the JavaScript Methods that can be used.
Calling conventions (JavaScript):
wherejQuery("#grid_id").jqGrid('editRow',rowid, keys, oneditfunc, succesfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc);
When set in the editRow the parameter function oneditfunc should not be enclosed in quotes and not entered with () - show just the name of the function.
If keys is true, then the remaining settings – succesfunc, url, extraparam, aftersavefunc, errorfunc and afterrestorefunc - are passed as parameters to the saveRow method when the [Enter] key is pressed (saveRow does not need to be defined as jqGrid calls it automatically). For more information see saveRow method below.
When this method is called on particular row, jqGrid reads the data for the editable fields and constructs the appropriate elements defined in edittype and editoptions
Saves the edited row.
jQuery("#grid_id").jqGrid('saveRow',rowid, succesfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc);
where
Except when url (or editurl) is 'clientArray', when this method is called, the data from the particular row is POSTED to the server in format name: value, where the name is a name from colModel and the value is the new value. jqGrid also adds, to the posted data, the pair id: rowid. For example,
jQuery("#grid_id").jqGrid('saveRow',"rowid", false);
will save the data to the grid and to the server, while
jQuery("#grid_id").jqGrid('saveRow',"rowid", false, 'clientArray');
will save the data to the grid without an ajax call to the server.
This method restores the data to original values before the editing of the row.
Calling convention:
jQuery("#grid_id").jqGrid('restoreRow',rowid, afterrestorefunc);
where
When the row is edited and the input elements are created we set the following rules:
When the data is posted to the server we construct an object {} that contain(s):