Hi,
I am having issue, that rows are not getting updated after calling the grid commit function.
See below code snippet, I had a debug point in the success function, and made sure there is an updated value being sent back in the response object. But I am not able to see the updated value in the grid. Can you please advice.
function saveChanges(addList,updateList,deleteList,rowIndxs){
var grid = $('#stylesGrid').pqGrid('getInstance').grid;
//var changes = grid.getChanges();
//console.log(changes);
if (addList.length || updateList.length || deleteList.length) {
$.ajax({
url: "/testPlanEdit.do",
data : {
list : JSON.stringify({
updateList : updateList,
addList : addList,
deleteList : deleteList
}),
action :'modify'
},
dataType : "json",
type : "POST",
async : true,
beforeSend : function(jqXHR, settings) {
$(".saving").show();
},
success : function(changes) {
grid.commit({
type : 'add',
rows : changes.addList
});
grid.commit({
type : 'update',
rows : changes.updateList
});
grid.commit({
type : 'delete',
rows : changes.deleteList
});
//refresh rows
for(var j in rowIndxs){
//grid.refreshRow({rowIndx:rowIndxs[j] });
grid.refreshCell({rowIndx:rowIndxs[j],dataIndx: 'totalUnits' });
}
},
complete : function() {
$(".saving").hide();
}
});
}
}