how to refresh a unique row after a ajax post

how to refresh a unique row after a ajax post

1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team July 17, 2019 08:41 AM UTC

Hi martiniano, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. We suspect that you would like to refresh only the particular edited row during update instead of refreshing the entire Grid. We would like to inform you than by default when you update a data in Grid, the entire Grid will be refreshed to reflect the changes in Grid. But based on your requirement, we suggest you to follow the below code to refresh only the particular row during editing. 

In the below code, we have bind the “actionBegin” event to Grid and in this event handler we suggest you to cancel the default save action by using “args.cancel = true” and then change the “isEdit” value to false. Then you need to update your service data base(from which Grid is currently populating) after this you need to update the “currentViewData” of Grid and finally call the “refreshRow” method of editModule in Grid with the edited values as argument for the method. Please refer the code below, 

 
    function actionBegin(args) { 
      if(args.requestType == "save"){ 
        args.cancel = true; 
        this.isEdit = false; 
        this.currentViewData[args.rowIndex] = args.data; 
        this.editModule.editModule.refreshRow(args.data); 
      } 
    } 
 

Documentation :  
 
Note : The above workaround will work only for inline mode of editing in Grid. 

Please get back to us if you need further assistance. 

Regards, 
Thavasianand S. 


Loader.
Up arrow icon