TreeView not calling CREATE method for newly appended node

5 posts, 0 answers
  1. Z
    Z avatar
    6 posts
    Member since:
    Feb 2008

    Posted 13 Jan 2015 Link to this post

    When a new node is appended to root, the HierarchicalDataSource correctly calls my remote CREATE method:

    var tv = $('#outlineEdit').data('kendoTreeView');
    tv.append({ text: 'test', parentId: 6}, null);
    me.outlineTreeDataSource.sync();

    However, when the node is appended to a parent node, no call is ever made to the remote server but the node is visually appended.  

    var tv = $('#outlineEdit').data('kendoTreeView');
    tv.append({ text: 'test', parentId: 6}, tv.findByText("Child 1.2"));
    me.outlineTreeDataSource.sync();


    I haven't found any example or documentation that shows how to do this 'correctly'.  Please advise!
  2. Z
    Z avatar
    6 posts
    Member since:
    Feb 2008

    Posted 13 Jan 2015 in reply to Z Link to this post

    (This is using Kendo UI v2014.3.1119)
  3. Kendo UI is VS 2017 Ready
  4. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 14 Jan 2015 Link to this post

    Hello Zaryn,

    You need to call the sync method of the child dataSource:

    var tv = $('#outlineEdit').data('kendoTreeView');
    var parentNode = tv.findByText("Child 1.2");
    tv.append({ text: 'test', parentId: 6}, parentNode);
    tv.dataItem(parentNode).children.sync();

     

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Z
    Z avatar
    6 posts
    Member since:
    Feb 2008

    Posted 14 Jan 2015 in reply to Alex Gyoshev Link to this post

    Ah!  Thank you :)

    I think that would be very information to document on the HierarchicalDataSource page and the TreeView page!  It's not documented on either one currently, or in any of the examples.
  6. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 16 Jan 2015 Link to this post

    Hello Zaryn,

    Indeed, synchronization of nodes is not well documented, and there are not any good examples on TreeView editing at this time. We have this on our to-do list for future releases.

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