I’m trying to reload my grid after modifying a cell but I get this error message: “Error in ajax request”.
Here’s my function:
afterSaveCell: function(rowid, name, val, iRow, iCol){
//... do some stuff ...
//save cell in the database
//... some more stuff ...
$("#grid").trigger("reloadGrid")
}
This grid is built on the server (I know my columns only at runtime), so I’m thinking that I should fire the hole $.ajax() function (in which all the grid definition is). Is this right? How can I do it?
I didn’t find a way of doing this. So I did the ajax request (which saves the values in the database) inside the
afterSubmitCellevent and then calculate the rest of the fields insideafterSaveCell(using javascript and a lot ofgetCellandsetCellcalls).In fact this ended up being a better way of doing this since the user doesn’t have to wait more than 1 second to see the updated values. Also the documentation of the
afterSaveCellevent says:The downside of going this way is that I have duplicated logic to calculate some columns of the grid (server-side in C# and client-side in javascript)