DataSource sync() order of execution for CRUD operations

5 posts, 0 answers
  1. Alexander
    Alexander avatar
    1 posts
    Member since:
    Mar 2015

    Posted 18 Mar 2015 Link to this post

    I noticed that datasource sync() method always executes synchronization operations in the following order: Create, Update, Destroy.
    It may cause a problem in some cases. Consider a situation, when we have some list of items with requirement that every item must be unique in the list and datasource have autoSync: false. The list contains item A already. We delete item A, then create the same item A and trying to sync() datasource. At one point the list will contain two A items, because kendo always executes Create before Destroy and I cannot find the way how to change this order from my code.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 20 Mar 2015 Link to this post

    Hello,

    This is by design and cannot be changed at this point.

    Regards,
    Atanas Korchev
    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. Salim
    Salim avatar
    28 posts
    Member since:
    Jun 2016

    Posted 24 Aug in reply to Atanas Korchev Link to this post

    I completly agree with Alexander. Was something done regarding the order of the Create, Update, Destroy?
  5. Stephen
    Stephen avatar
    86 posts
    Member since:
    Jan 2011

    Posted 25 Aug in reply to Salim Link to this post

    I stopped using the built-in sync() a while ago and submit all my grids with a variation of this technique: http://www.telerik.com/support/code-library/save-all-changes-with-one-request

     

    This way, you have complete control of the order of the save, can validate across the entire resulting dataset(i.e. no duplicate rows), can have the create/update/delete inside a single DB transaction, etc.

  6. Salim
    Salim avatar
    28 posts
    Member since:
    Jun 2016

    Posted 25 Aug in reply to Stephen Link to this post

    This is what I did also. I used the submit event
Back to Top
Kendo UI is VS 2017 Ready