Is there no "Keep in Sync" option?

7 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 26 Jun 2013 Link to this post

    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
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 28 Jun 2013 Link to this post

    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
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 28 Jun 2013 Link to this post

    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*...

  5. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 28 Jun 2013 Link to this post

    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
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 28 Jun 2013 Link to this post

    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.
  7. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 01 Jul 2013 Link to this post

    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
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 01 Jul 2013 Link to this post

    Okay so the function is there....but it's up to me to handle
Back to Top
Kendo UI is VS 2017 Ready