Hi Jonathan,
Sorry we misunderstood your query mentioned in the previous update. From the modified sample shared we could see that you have reported that the “this.load();” method in the sample is getting called again when the refreshColumns method is invoked. This is because the dataBound event will be triggered each time the Grid data is modified or updated and so we have handled this case using a global flag variable so that the action is only executed once.
The problem in the shared sample is that the global flag variable was not disabled(set as false) in the event function start and this was causing the load condition to be executed again. So you can resolve this problem by disabling the flag variable in the start of the event handler itself as demonstrated in the below code snippet,
dataBound = () => {
if (this.initialRender) {
this.initialRender = false;
this.load();
this.gridRef.current.refreshColumns();
}
}; |
Please find the below modified sample based on this for your reference,
Note: We also would like to inform you that as mentioned in the previous update when modifying the Grid properties dynamically, the Grid’s refresh or refreshColumns method needs to be called in order to properly update the changes. This is because with remote data the Grid will only have access to the current page data and not the entire data and so for the changes to be refreshed properly, the server request has to be sent in order to fetch the updated data.
Let us know if you have any concerns.
Regards,
Sujith R