
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve
asked on 26 Jun 2013, 06:56 PM
I have mis-wired up my update call...so in firebug I see the ajax call just tank, however the client object updates perfectly fine...idea is there's no "save" button changes are reflected instantly.
Am I missing this option in the docs? autoSync doesn't seem to do it (or maybe is *causing* it)
Steve
Am I missing this option in the docs? autoSync doesn't seem to do it (or maybe is *causing* it)
Steve
6 Answers, 1 is accepted
0
Hello Steve,
The dataSource submits pending changes to the server through the sync method. If the autoSync option is enabled, then the synchronization will be triggered automatically as soon as the data changes.
If autoSync is disabled (that is the default state) changes should be submitted manually - when the user clicks a button or by the developer via JavaScript API.
I hope this information will help.
Regards,
Alexander Valchev
Telerik
The dataSource submits pending changes to the server through the sync method. If the autoSync option is enabled, then the synchronization will be triggered automatically as soon as the data changes.
If autoSync is disabled (that is the default state) changes should be submitted manually - when the user clicks a button or by the developer via JavaScript API.
I hope this information will help.
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 28 Jun 2013, 01:19 PM
It helps understand what happens with the datasource, but if the update call fails, shouldn't the update on the client then also "revert"\not save? Because once the $ajax tanks the data from the kendo DS is now *BAD*...
0
Hi Steve,
If the transport operation is not successful (in your case the update Ajax request fails), the DataSource will attempt to re-submit the changes during next synchronization. In other words the changes will be still considered as pending.
If you want to revert the changes upon transport failure, I suggest hooking up to the error event of the DataSource and calling cancelChanges method.
On a side note, I do not understand what you mean by "Because once the $ajax tanks the data from the kendo DS is now *BAD*...". In case you need further assistance, please provide a more detailed description.
Regards,
Alexander Valchev
Telerik
If the transport operation is not successful (in your case the update Ajax request fails), the DataSource will attempt to re-submit the changes during next synchronization. In other words the changes will be still considered as pending.
If you want to revert the changes upon transport failure, I suggest hooking up to the error event of the DataSource and calling cancelChanges method.
On a side note, I do not understand what you mean by "Because once the $ajax tanks the data from the kendo DS is now *BAD*...". In case you need further assistance, please provide a more detailed description.
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 28 Jun 2013, 02:28 PM
Clarification:
Kendo says value is 3, trys the ajax callback...fails, but kendo doesn't revert back to the previous value
So now kendo (and thus the user) thinks they've successfully updated the value to "3", but they haven't.
Kendo says value is 3, trys the ajax callback...fails, but kendo doesn't revert back to the previous value
So now kendo (and thus the user) thinks they've successfully updated the value to "3", but they haven't.
0
Hi Steve,
As I tried to explain in my previous post, if the Ajax call fails Kendo DataSource will not revert the back to the previous value. It will try to re-submit the change when the DataSource is synchronized again.
If you want to revert the changes upon transport failure, I suggest hooking up to the error event of the DataSource and calling cancelChanges method.
Did you tried this solution? What kind of problems you experienced with it?
Regards,
Alexander Valchev
Telerik
As I tried to explain in my previous post, if the Ajax call fails Kendo DataSource will not revert the back to the previous value. It will try to re-submit the change when the DataSource is synchronized again.
If you want to revert the changes upon transport failure, I suggest hooking up to the error event of the DataSource and calling cancelChanges method.
Did you tried this solution? What kind of problems you experienced with it?
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 01 Jul 2013, 02:41 PM
Okay so the function is there....but it's up to me to handle