in jqgrid for inline editing when we click the save icon, ** internally it calls the saveRow method, but i want to call my custom method where i will implement my save logic as well calling to controller method.**
i used below code for grid.
var grid = jQuery("#list5").jqGrid({
url: '/home1/GetUserData',
datatype: "json",
mtype: "POST",
colNames: ['Code', 'LoginID', 'Emailid', 'CreateDate', 'PostalCode', 'Mobile'],
colModel: [
{name: 'Code', index: 'Code', width: '16%', editable: true, sortable: true },
{ name: 'LoginID', index: 'LoginID', width: '16%', editable: true, sortable: true },
{ name: 'Emailid', index: 'Emailid', width: '16%', editable: true,
sortable: true },
],
rowNum: 10,
height: '100%',
scrollOffset: 0,
rowList: 10,
shrinkToFit: true,
pager: $("#pager2"),
editurl: "/home1/EditUserData",
caption: "Simple data manipulation"
});
jQuery("#list5").jqGrid('navGrid', '#pager2', { edit: false, add: false, del: true, search: false, refresh: false }, {}, {}, { url: '/home1/DeleteUserData' });
jQuery('#list5').jqGrid('inlineNav', '#pager2', { edit: true, add: true},
});
});
so please anyone let me know how to implement it.
I don’t really understand your requirements. saveRow has a lot of customization possibilities. You can rename all parameters which will be sent to the server using
prmNamesoption of jqGrid. Usingextraparamparameter of saveRow you can specify additional information which can be sent to the server. The callbackserializeRowDatacan be used to implement your custom serialization. For example you can convert the data to JSON. Usingaftersavefuncyou can make some custom actions after the data will be successfully saved on the server. So I recommend you use the features instead of implementing your customsaveRowmethod.UPDATED: If you want to have navigator icon which uses your custom
saveRowyou should don’t add “Save” button by inlineNav. You can usesave: falseoption of inlineNav. Then you can just use navButtonAdd and add your custom icon which look exactly like original “Save” button and make call of your “customsaveRow” in theonClickButtoncallback.