Angular TreeView sorting children of an node by index

2 posts, 0 answers
  1. Julian
    Julian avatar
    1 posts
    Member since:
    Dec 2012

    Posted 12 Dec 2014 Link to this post

    I have an angular TreeView, and I need to reorder nodes from a specfic parent by a item property (index).
    How can I do this?
  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 16 Dec 2014 Link to this post

    Hello Julian,

    If you want to reorder the items of the treeview you need to change the item order in that specific level of the dataSource hierarchy - the TreeView will automatically react to the change and redraw itself.

    The methods which you can use of the Hierarchical dataSource are the same that the regular DataSource has. Check the examples in the documentation:

    Removing an item from the dataSource and inserting it at specific position should handle this reordering that you look for. To get the current items of the dataSource use the data method.

    Kind Regards,
    Petur Subev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top