Hello,
I am trying to save the state of my grid whenever a select a row, I have tried two approaches but none of them seems to work.
When I do this:
$(“#” + gridName + “jqxgrid”).bind(‘rowclick’, function (event) {
var gridState = JSON.stringify($(“#” + gridName + “jqxgrid”).jqxGrid(‘savestate’));
SaveGridStateDB(gridName, gridState, GridUserID, GridServiceURL, GridProjectName);
});
The result is that it sends in my stringify stuff this : \”],\”selectedrowindexes\”:[0],\”selectedrowindex\”:0,\”, but that zero correspond to the previous click, not the actual one. I am assuming the click event happens before rowselect.
The other approach is when I do this:
$(“#” + gridName + “jqxgrid”).bind(‘rowselect’, function (event) {
var gridState = JSON.stringify($(“#” + gridName + “jqxgrid”).jqxGrid(‘savestate’));
SaveGridStateDB(gridName, gridState, GridUserID, GridServiceURL, GridProjectName);
});
The result is that it sends in my stringify stuff this: \”],\”selectedrowindexes\”:[],\”selectedrowindex\”:-1,\”, even though I am selecting a row. So I am assuming there should be another method like “afterrowselected” or “rowselected” but I can’t see that in the API.
Can you help me out?
Regards.