JqGrid save inline editing callback

JqGrid save inline editing callback

Here is a quick snippet for callback when saving inline editing in JqGrid:

1
2
3
4
5
6
7
8
9
10
11
12
// http://stackoverflow.com/questions/13303698/total-of-amount-in-jqgrid
ondblClickRow: function (rowid, name, val, iRow, iCol) {
    $(selector).jqGrid("editRow", rowid, {
        keys: true,
        aftersavefunc: function (rowid) {
            var $grid = $(selector);
            var colSum = $grid.jqGrid('getCol', 'debit', false, 'sum');
            $grid.jqGrid('footerData', 'set', { 'debit': colSum });
           
        }
    });
},

In this example, we do calculation after inline edit save.

Leave a Reply

Your email address will not be published. Required fields are marked *