- Home
- Forum
- React - EJ 2
- Calling a function from Inline Editing CRUD functionality
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
SIGN IN To post a reply.
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'];
... |
Documentation: https://ej2.syncfusion.com/documentation/api/grid/#addrecord
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
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
HY Hiro Yoneyama
- Dec 11, 2018 04:18 AM UTC
- Dec 13, 2018 08:36 AM UTC