This is a migrated thread and some comments may be shown as answers.

cancelChanges is reverting even synced records to initial state

2 Answers 81 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Dirk
Top achievements
Rank 1
Dirk asked on 08 Feb 2016, 10:04 AM

Hi,

i created a datasource that's bound to a grid. When i edit a row of a grid and save the changes i do a sync. The update method is called and returned with an code of 200.

I then try to edit another row, but cancel this changes. In my cancel method of the datasource i call the dataSource.cancelChange() method.

But now all changes (even the synced ones) are reverted to the initial state ? Why ? What i am doing wrong in this scenario ?

 

Regards

Dirk

 

2 Answers, 1 is accepted

Sort by
0
Dirk
Top achievements
Rank 1
answered on 08 Feb 2016, 01:45 PM

Hi,

sorry for the post - i found the reason why this was happening.

When i send the data to the update routine on the server  i did not send an id back to the client.

It would be nice if the documentation could specify, that a sync needs the updated data back to the client.

 

Dirk

0
Rosen
Telerik team
answered on 10 Feb 2016, 09:18 AM

Hello Dirk,

We are glad that you have address the issue were facing. Indeed, the update method should return the updated records, this is mentioned in the documentation here.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Dirk
Top achievements
Rank 1
Answers by
Dirk
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or