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 afterSubmitCell event and then calculate the rest of the fields inside afterSaveCell (using javascript and a lot of getCell and setCell calls).
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 afterSaveCell event says:
Applies only to a cell that is editable; this event fires after the cell has been successfully saved. This is the ideal place to change other content.
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)
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论