Row reset after batchedit success

Hi


I encounter behavior on a board that uses the bacth edit to update the cells.
I use BathcUrl and RemoteSaveAdaptor to call an API when a user validates a line update. I recover the data well in my API and I manage to properly update my database.
The problem comes once my API returns a 200 code and I enter my success function in js file, at this point the data that had modified is returned to its original value.
I enclose excerpts of my code (my table, the API called and my success code)
Do I have to do anything specific for the data is not reset ?


Thanks Quentin


Attachment: Sample_4a0e7d9d.zip

1 Reply

PS Pavithra Subramaniyam Syncfusion Team February 17, 2022 07:39 AM UTC

Hi Chaffois, 
 
Thanks for contacting Syncfusion support. 
 
We have validated the provided code example and suspect that the return data from the BatchUrl method is not in the correct format. 
 
When using remoteSaveAdaptor with batchUrl , all the CRUD changes need to be returned as response. This is demonstrated in the below code snippet, 
 
Request to the controller 
 
 
 
the batch method arguments need to be accessed by using “CRUDModel” class 
 
 
 
 
Finally the batch method arguments is returned from the controller as like below 
 
 
public ActionResult BatchUpdate(CRUDModel batchmodel) // get the batch arguments using CRUDModel class 
        { 
            // perform your actions 
 
            return Json(new { added = batchmodel.Added, changed = batchmodel.Changed, deleted = batchmodel.Deleted, value = batchmodel.Value, action = batchmodel.action, key = batchmodel.key }); // return batch arguments with this format to client 
 
        } 
        public class CRUDModel 
        { 
            public List<BigData> Added { get; set; } 
            public List<BigData> Changed { get; set; } 
            public List<BigData> Deleted { get; set; } 
            public BigData Value { get; set; } 
            public int key { get; set; } 
            public string action { get; set; } 
        } 
 
 
Response from the controller: 
 
 
 
We have prepared a simple sample with remoteSaveAdaptor and batchUrl, you can get it from the below link. 
 
 
If you are still facing the issue, please share the below details that will be helpful for us to provide a better solution as early as possible 
 
  1. Ensure whether the return data is in correct format
  2. Ensure whether the data is updated in the database properly and “ListeDetailSaisieParcelle” is updated
  3. Share the Syncfusion package version
  4. Is there any script error?
 
Regards, 
Pavithra S 


Loader.
Up arrow icon