Hi Boopathy,
Thanks for contacting Syncfusion support.
When you change the Grid properties programmatically, Grid
will automatically get refreshed and send a request to the server. If you change
multiple properties at a time, it refreshes the Grid multiple times and sends
multiple requests to the server. This is the behavior of Grid.
If you want to apply multiple changes in the Grid with a single refresh, you can achieve this by using setProperties and freezeRefresh
methods.
|
btnClick: function (args) {
var query = new Query();
var grid =
this.$refs.grid.ej2Instances;
grid.setProperties(
{
pageSettings: { currentPage: 1
}, // change the page settings
query: query, // change the grid query
sortSettings: { columns: [] },
// clear the sort settings
},
true); // change the Grid properties without refresh
grid.freezeRefresh(); // refresh the grid
}
|
Sample: https://codesandbox.io/s/vue-template-forked-0tw7kg?file=/src/App.vue
Please get back to us if you need further assistance.
Regards,
Rajapandiyan S