I have two jqGrids on a page. The idea is to display a confirmation dialog when a drop down value is updated and when the user presses enter to save the record both jqGrids get reloaded.
Here's my column model:
{
key: false, name: 'InterestedValue', index: 'InterestedValue', editable: true,
sortable: false, formatter: 'select', width: '120px', search: false,
edittype: 'select',
editoptions: {
value: InterestedStatusList,
//afterSaveCell: function (rowid, cellname, value, iRow, iCol) {
// alert("after savecell" + rowid + " cellname= " + cellname);
// //$(this).trigger('reloadGrid');
//},
successfunc: function (response) {
alert("success");
//FLAG = true;
$(this).trigger('reloadGrid')
return true;
}
}
},
And event,
serializeRowData: function (postdata) {
var response = JSON.stringify(postdata);
var s = '';
$(postdata).each(function (index, data) {
//s += '<option value="' + index + '">' + data + '</option>';
$.each(data, function (k, v) {
if(k=="InterestedValue")
s += v;//'<option value="' + k + '">' + v + '</option>';
});
});
//
if (s == "2_1") {
if (confirm('Are you sure you want to deactivate this record? ')) {
// do things if OK
return postdata;
}
else
return false;
}
return postdata;
},
I am able to get the edit action method called with data after the serializeRowData
event. But I can't figure out how to trigger the reload of the Grids after the update is done successfully. So please tell me which event gets fired after the serializeRowData
. I tried the successfunc
in the column as well, but this is fired as soon as the I click the row and it goes into Edit-mode.