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

Clear selection and collapse all nodes

2 Answers 72 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
JULIA
Top achievements
Rank 1
JULIA asked on 06 Dec 2010, 10:43 AM
Hello,

how can i clear the selection and collapse all nodes?

Regards,
Timo

2 Answers, 1 is accepted

Sort by
0
Federico
Top achievements
Rank 1
answered on 24 Sep 2011, 01:17 AM
You can use the following code to clear the TreeView selection:

var tvData = $('#TreeView').data('tTreeView');

$(".t-state-selected", tvData.element).removeClass('t-state-selected');


0
Dimo
Telerik team
answered on 26 Sep 2011, 09:26 AM
Hello Julia,

You can collapse all TreeView nodes like this:

var treeView = $("#TreeViewID").data("tTreeView");
var items = $("> ul > li", treeView.element);
treeView.collapse(item);


Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
TreeView
Asked by
JULIA
Top achievements
Rank 1
Answers by
Federico
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or