This question is locked. New answers and comments are not allowed.
Khurrum Mahmood
Top achievements
Rank 1
Khurrum Mahmood
asked on 19 May 2010, 10:14 PM
Hi guys,
Any quick code to find the currently selected tree node?
4 Answers, 1 is accepted
0
Hello Khurrum,
If you want to get the text of the selected node, you can use the following: $('#TreeView .t-state-selected').text(). (TreeView is the name of the treeview).
Regards,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
If you want to get the text of the selected node, you can use the following: $('#TreeView .t-state-selected').text(). (TreeView is the name of the treeview).
Regards,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Khurrum Mahmood
Top achievements
Rank 1
answered on 20 May 2010, 06:11 PM
Thanks Alex, I was looking for the selected value and I tried the val() method, but it returns an empty value.
0
Hello Khurrum,
Getting the value can be achieved using the following JavaScript:
var treeview = $('#TreeView');
var selectedItem = treeview.find('.t-state-selected').closest('.t-item');
treeview.data('tTreeView').getItemValue(selectedItem);
Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Getting the value can be achieved using the following JavaScript:
var treeview = $('#TreeView');
var selectedItem = treeview.find('.t-state-selected').closest('.t-item');
treeview.data('tTreeView').getItemValue(selectedItem);
Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
shilpa
Top achievements
Rank 1
answered on 06 Aug 2010, 01:52 PM
Hi,
How can get checked node from treeview?
How can get checked node from treeview?