To refresh the data in JQGrid, you can use the trigger
method with the "reloadGrid"
event. Here is an example code snippet that demonstrates how to refresh the data in JQGrid:
javascript// Assuming the grid's ID is "myGrid"
$("#myGrid").trigger("reloadGrid");
In this example, we use the trigger
method to reload the data in the grid with the ID "myGrid"
. The "reloadGrid"
event tells JQGrid to refresh the grid data from the server or local data source.
Note that if you need to pass additional parameters to the server when reloading the grid data, you can include them as an object argument to the trigger
method. For example:
javascript// Assuming the grid's ID is "myGrid" and we need to pass additional parameters to the server
var additionalParams = {param1: "value1", param2: "value2"};
$("#myGrid").trigger("reloadGrid", [additionalParams]);
In this example, we pass an object with two properties (param1
and param2
) as the second argument to the trigger
method. These properties represent the additional parameters to be passed to the server when reloading the grid data. The "reloadGrid"
event will still be used to trigger the data refresh.
Comments
Post a Comment