Hi all,
How can I get the item value based on the clicked checkbox?
I need to filter a grid based on the clicked chebox in the treeview (I'll do this using json).
Regards,
Pedro
3 Answers, 1 is accepted
0
Alex Gyoshev
Telerik team
answered on 09 Aug 2010, 09:46 AM
Hello Pedro,
If you are subscribed to the onChecked client-side event, you can use the following script to get the item value: var treeview = $('#TreeView').data('tTreeView');
var value = treeview.getItemValue(e.item);
If you want to get the values of all checked treeview items, you can use the following: var $treeviewElement = $('#TreeView1');
var treeview = $treeviewElement.data('tTreeView');
var values = [];
$treeviewElement.find(':checked').each(function() {
var item = $(this).closest('.t-item');
values.push(treeview.getItemValue(item));
}); // values is now an array that contains all checked items' values
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
Thank you Alex, but I dont have the onChecked event in the TreeView (I think i'm using a old version of the control). :(
Can I update the control? (I'm not using the .Net 4 framework)
Is This the best choice?