Anuja Anuja - 1 year ago 200
jQuery Question

aftersavefunc is not work in inline JqGrid properly

I am working on that inline jqgrid I want to display sum of column of jqGrid into another text box outside jqgrid.I am do some code for that. the code is below

$("#ItemGrid").jqGrid("inlineNav", "#nav-ItemGrid", {
edit: true,
add: true,
addicon: "ui-icon-plus",
save: true,
view: true,
cancel: false,
editParams: {
aftersavefunc: function () {
var colSum = $('#ItemGrid').jqGrid('getCol', 'Total', false, 'sum');
keys: true
addParams: {
position: 'last',
aftersavefunc: function () {
var colSum = $('#ItemGrid').jqGrid('getCol', 'Total', false, 'sum');
}, keys: true

this code is work only for editParams not for AddParams.But I can not understand why this is happen.Please give some suggestion.
Thanks in advance..........

Answer Source

You use addParams property of inlineNav in the wrond way. The options of inline editing like position: 'last' and aftersavefunc have to be inside of property addRowParams of addParams. See the answer for example for more details. If you use free jqGrid then I'd recommend you to use inlineEditing option of jqGrid to set default properties of inline editing. See the wiki article for more details.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download