We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Calling a function from Inline Editing CRUD functionality

Hi,

I'm looking at the Inline Editing Grid and wondering how can I make custom calls to a function (in my case a Redux action), for Add, Delete and Update? Would I have to use the dataStateChange function in the GridComponent?

Regards,

Hiro

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team December 12, 2018 06:57 AM UTC

Hi Hiro, 

Thanks for contacting Syncfusion support. 

Query :  I'm looking at the Inline Editing Grid and wondering how can I make custom calls to a function (in my case a Redux action), for Add, Delete and Update? 

We have analyzed your query and we can make custom calls to the Add, Delete and Update operation functions using grid methods as mentioned below,  

Code Example

[sample-base.js] 
... 
           toolbarClick(args) { 
          if(args.item.id=="grid_CustomAdd"){ 
            this.addRecord();                        //for add operation 
          } 
          else if(args.item.id=="grid_CustomEdit"){ 
            this.startEdit();                        //for edit operation 
          } 
          else if(args.item.id=="grid_CustomDelete"){ 
            this.deleteRecord(this.getSelectedRows()[0]);    //for delete operation 
          } 
          else if(args.item.id=="grid_CustomUpdate"){      
            this.endEdit();                                  //for update operation 
          } 
        } 
... 

[index.js] 
... 
this.toolbarOptions = ['CustomAdd', 'CustomEdit', 'CustomDelete', 'CustomUpdate', 'Cancel']; 
... 


                                https://ej2.syncfusion.com/documentation/api/grid/#startedit 
                                https://ej2.syncfusion.com/documentation/api/grid/#endedit  
                                https://ej2.syncfusion.com/documentation/api/grid/#deleterecord  

Please get back to us for further assistance. 
 
Regards, 
Thavasianand S. 



HY Hiro Yoneyama December 13, 2018 01:07 AM UTC

Thank you for the response, I think this should work for our purposes.

Regards,

Hiro


MF Mohammed Farook J Syncfusion Team December 13, 2018 08:36 AM UTC

Hi Hiro,  
 
Thanks for your update. 
 
We are happy to hear that the provided solution has been resolved your problem. 
 
Please get back to us if you need further assistance. 
 
Regards 
J Mohammed Farook 
 


Loader.
Live Chat Icon For mobile
Up arrow icon