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

Unselect selected node

3 Answers 1613 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Gema
Top achievements
Rank 1
Gema asked on 21 Mar 2012, 07:10 AM
Hi, 

As subject. is it possible to unselect selected node (clearing yellow select-mark) ?

Regards,
Gema Pratama

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 21 Mar 2012, 09:15 AM
Hi Gema,

I am afraid there is no unselect method available in the API, however you could remove the corresponding CSS class with jQuery. For example:
var treeview = $("#treeview").data("kendoTreeView");
treeview.select() //gets currently selected <li> element
    .find("span.k-state-selected")
        .removeClass("k-state-selected"); //removes the highlight class


Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Gema
Top achievements
Rank 1
answered on 04 Apr 2012, 09:16 AM
Hi Valchev, 

Thank you for your tips ... :) 

Regards,
Gema Pratama
0
Jark Monster
Top achievements
Rank 1
answered on 26 Apr 2013, 06:44 PM
I found this in the documentation for Treeview.  It was probably added to the Treeview widget after this post was resolved, but I wanted to update it.

You can deselect all selected nodes with the following syntax:
var treeView = $("#treeView").data("kendoTreeView");
treeView.select($());
Kendo UI Treeview Documentation for Select
Tags
TreeView
Asked by
Gema
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Gema
Top achievements
Rank 1
Jark Monster
Top achievements
Rank 1
Share this question
or