This is a migrated thread and some comments may be shown as answers.

Help me, (expand and Collapse of a node in treeview)

2 Answers 159 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Butter
Top achievements
Rank 1
Butter asked on 29 Jul 2013, 10:23 AM
I want to use event ( onSelect) to help me (expand or Collapse ) one node in treeview
pls hepl me do it.
my code here:
(
     function onSelect(e){
             if (this.dataItem(e.node) != null) {
                  this.expand(e.node);
                 this.collapse(e.node);
             }
        }
)

2 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 29 Jul 2013, 01:55 PM
Hello Butter,

You need to use an instance of the TreeView and use its .expand() and .collapse() methods to perform the functionality you need. You can check for the data-expanded attributed in order to determine of give node is expanded or note. For your convenience here is a jsBin example which demonstrates a possible implementation.

 

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Butter
Top achievements
Rank 1
answered on 30 Jul 2013, 03:13 AM
wow  amazing, i have been do it  
thank you ,Kiril Nikolov
Tags
TreeView
Asked by
Butter
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Butter
Top achievements
Rank 1
Share this question
or