Hi Feifan,
Greetings from Syncfusion support.
Query: “How can I get the access to the "Save" button and handle the data format beforehand? And can I hit a customize api endpoint instead of the default DataManager Adaptor?”
We suggest you to achieve your requirement using OnActionBegin event of EjsGrid when RequestType is Save. OnActionBegin event will be triggered when an certain action is initiated. So while saving the record. OnActionBegin event will be triggered with a RequestType as Save.
Refer the below code example.
|
<EjsGrid @ref="@SiteGrid" TValue="Site" AllowPaging="true" AllowSorting="true" AllowFiltering="true" AllowGrouping="true"
Toolbar="@(new List<string>() { "Add", "Edit", "Update", "Delete", "Search"})">
<GridEvents OnActionBegin="Begin" TValue="Site"></GridEvents>
. . . . . . .. . . . . . ..
</EjsGrid>
. . . . . . . . . public void Begin(ActionEventArgs<Site> Args) { if(Args.RequestType == Syncfusion.EJ2.Blazor.Grids.Action.Save) { Args.Cancel = true; // prevents the default actions. var data = Args.Data; // gives the inserted / edited records. // from here call your server to make changes in your database // refresh the Grid } }
|
Refer our UG documentation for your reference
if above solution does not resolve your query, kindly get back to us with more details about your requirement.
Regards,
Vignesh Natarajan.