How to get the changed data when triggering a batchUpdate with a custom button outside the grid.

Hi,

I'm using an external button to trigger my batchUpdate, when using the toolbar update button, everything works perfectly and I get the right action called within my controller and having a list of the changes.

 But when I want to do it manually :

function externalButtonClick(){

        var gridObj = document.getElementById('Grid').ej2_instances[0];
        gridObj.batchUpdate(); //

}

I guess I would need to provide myself the changes as parameters of the batchUpdate method, but I don't know how to get them, is there a property in my gridObj where I can access the changes ? Or any other way ?

Thanks for the help, if you need any more information I'll gladly upload some more or screenshots.

3 Replies 1 reply marked as answer

MS Manivel Sellamuthu Syncfusion Team April 30, 2021 02:42 PM UTC

Hi Remy, 

Greetings from Syncfusion support. 

From your requirement we can understand that you want to save the batch changes externally using grid methods. You can use endEdit method of the grid or batchSave method of the Grid Edit module to achieve your requirement. Please refer the below API for more information. 


  gridObj.endEdit(); 

(Or)    
    
 gridObj.editModule.batchSave(); 

Please let us know if you need further assistance. 

Regards, 
Manivel 


Marked as answer

RV Remy V May 3, 2021 02:40 PM UTC

Hi, 

It is exactly the information I needed.
Thanks again for the quick support.

Have a great day,
Remy


MS Manivel Sellamuthu Syncfusion Team May 4, 2021 05:39 AM UTC

Hi Remy, 

Thanks for your update. 

We are glad that the provided solution resolved your requirement. 

Please let us know, if you need further assistance. 

Regards, 
Manivel 


Loader.
Up arrow icon