how to save the records in the database
I am trying to save the edited and added data in the database, this from webassembly but actioncomplite does not resolve when there are changes in the data
SIGN IN To post a reply.
7 Replies
PP
Pooja Priya Krishna Moorthy
Syncfusion Team
September 6, 2021 08:44 AM UTC
Hi Wender,
Thanks for contacting Syncfusion support. Please refer the below documentation link to update DB on crud operations.
Please get back to us if you need more detail on this.
Regards,
Pooja K.
WS
Wender Schulze
September 6, 2021 05:49 PM UTC
Thanks, this works for me, not the only thing that doesn't work for me is when the "Indent" option is pressed and when the task progress is changed from the bar, do you have any idea how to update the database when those actions happen
PP
Pooja Priya Krishna Moorthy
Syncfusion Team
September 7, 2021 11:44 AM UTC
Hi Wender,
We are sorry for the inconvenience caused.
To update DB on indent/outdent action, we also need to update ParentId at the server side as like below code example. We will include the changes in the documentation.
|
public override object BatchUpdate(DataManager dm, object changedRecords, object addedRecords, object deletedRecords, string keyField, string key, int? dropIndex)
{
//…
for (var i = 0; i < changed.Count(); i++)
{
var value = changed[i];
GanttData result = db.GanttData.Where(or => or.Id == value.Id).FirstOrDefault();
//…
result.Progress = value.Progress;
result.ParentId = value. ParentId;
db.SaveChanges();
}
}
|
Also, this BatchUpdate method is called for cell editing, dialog editing and in taskbar editing. Please make sure whether all the fields which need to be update in DB are updated properly.
Please feel free to contact us if you have any other queries. As always, we will be happy in assisting you.
Regards,
Pooja K.
WS
Wender Schulze
September 7, 2021 03:20 PM UTC
Thanks for the prompt response, the problem I have is that in those scenarios the BatchUpdateAsync method is not called
MS
Monisha Sivanthilingam
Syncfusion Team
September 8, 2021 01:06 PM UTC
Hi Wender,
We have analyzed your query and would like to inform that the BatchSave method is called when performing cell editing, dialog editing and taskbar editing actions also. Please ensure that you have mapped the URL to the BatchSave method in your application like shown below.
Index.razor
|
<SfDataManager Url="/api/Values/GetData" Adaptor="Adaptors.UrlAdaptor" BatchUrl="/api/Values/BatchSave"></SfDataManager>
|
Please share with us an issue reproducible sample if you are still facing issues where the BatchUpdate method is called.
Regards,
Monisha.
WS
Wender Schulze
September 16, 2021 01:11 PM UTC
Thank you so much
MS
Monisha Sivanthilingam
Syncfusion Team
September 17, 2021 05:36 AM UTC
Hi Wender,
You are welcome.
Please contact us if you require any further assistance.
Regards,
Monisha.
SIGN IN To post a reply.
- 7 Replies
- 3 Participants
-
WS Wender Schulze
- Sep 5, 2021 01:23 AM UTC
- Sep 17, 2021 05:36 AM UTC