Kendo UI dataSource sync on button

4 posts, 0 answers
  1. Mirza
    Mirza avatar
    7 posts
    Member since:
    May 2013

    Posted 07 Jun 2013 Link to this post

    i have kendo ui datasource sync.

    Here is the link:
    http://jsbin.com/uhamer/3

    When you click on list, article will show in grid list(down), then if you click again on same article, it will increse quantity +1. In that new dataSource that should be synced, schema.model.id is set to id.

    When i click on Send data button, it shows me error.

    Firebug:
    TypeError: r is undefined

    Chrome:
    Uncaught TypeError: Cannot read property 'data' of undefined<br>

    What am i doing wrong here?

    Thanks.
  2. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 11 Jun 2013 Link to this post

    Hello,

    The error is thrown because the configuration for the update request is not specified in the transport. The item added to the Grid dataSource is assigned an id that is different than the default value and so the update request will used instead of create. The error is thrown only when clicking twice because in the code the item is modified and the dirty flag is set to true only when the item is already in the Grid data. You should either set the options for the update request or not assign an id for the new item.

    Regards,
    Daniel
    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. Thierry
    Thierry avatar
    14 posts
    Member since:
    Feb 2011

    Posted 20 Aug 2015 Link to this post

    Hi Daniel,

    Can you provide a sample with an update feature as I'm facing the same issue.

     

  5. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 24 Aug 2015 Link to this post

    Hi,

    I am not sure if I understand the question but all of the editing demos include the update operation. It is used to update an already existing item on the server.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready