Hi Muzaffer Birben,
Thanks for contacting Syncfusion support.
Based on your query .We can achieve your requirement by using actionBegin (with requestType as ‘beginEdit’ or ‘add’) and actionComplete (with requestType as ‘save’) event of Grid.
Here we can show and hide the external button based on Grid edit state. Please find the code example for your reference.
[code example]
|
actionBegin: function(args: EditEventArgs) {
if (args.requestType === "beginEdit" || args.requestType === "add") {
document.getElementsByClassName("button")[0].classList.add("show");
document.getElementsByClassName("button")[0].classList.remove("hide");
}
},
actionComplete: function(args: EditEventArgs) {
if (args.requestType === "save") {
document.getElementsByClassName("button")[0].classList.remove("show");
document.getElementsByClassName("button")[0].classList.add("hide");
}
}
});
grid.appendTo("#Grid");
document.getElementById('btn').addEventListener('click', function(e){
grid.endEdit();
}) |
In the above code example , we have saved the edited records by using ‘endEdit()’ method of Grid while clicking the external button.
Please check below sample and documentation for your reference.
API documentation :
Let us know if you have any concerns.
Regards,
Shalini M.