What is the correct way to save a node children?

2 posts, 0 answers
  1. Bassanio
    Bassanio avatar
    11 posts
    Member since:
    Sep 2013

    Posted 12 Feb 2014 Link to this post

    Hello,

    I have a Hierarchical Data Source and work fine for display in ListView.

    I can also CRUD the root level without problem. However, I could not update the second level (node.children).

    No mater tried node.children.sync(), or even the top <Hierarchical Data Source>.sync(), the update function of transport had not been triggered. 

    I tried modify a child record: node.children.at(0).set('newKey', 'newValue'). node.children.hasChanges() retuned True. After node.children.sync(), node.children.hasChanges() retuned False. But Transport.update had not been triggered so that nothing was written into datasource.

    Any idea?

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 14 Feb 2014 Link to this post

    Hello Bassanio,

    See this jsBin sample for a simple example how to sync the TreeView upon editing. An important thing to note is that nodes need to have IDs in order for the update / destroy operations to work (items without IDs are considered as not synchronized). Thus, the create action needs to return the ID upon successful creation of items.

    Regards,
    Alex Gyoshev
    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
Back to Top