Search code examples
kendo-uikendo-datasource

Kendo datasource read(), sync() and cancelChanges()


I've an issues with the Kendo datasource.

I read the data then I works on dataitem and so I sync the datasource, it is working well and datas are well saved in DB. But if I works on dataitem after the sync and I cancel changes, the datasource back to the read state and not to the sync state.

So how to sync data and commit state without ask a read after a sync ?

Thanks for your help.


Solution

  • Are you experiencing this for all scenario's (Create/Update)? You should not have this for Update but can face this for Insert if your service is not sending newly generated Id's back. (Hope you have a Id for your model). Once you have the Id you can add that to your grid source. I have done this few months back but don't have the code now.

    May be this post can give more detailed information http://www.telerik.com/forums/refresh-grid-after-datasource-sync