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

[Solved] Value of Selected treeview node

0 Answers 32 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.
Zeb
Top achievements
Rank 1
Zeb asked on 31 Jul 2012, 10:35 AM
<%:
        Html.Telerik().TreeView()
        .Name("ZebTree")
        .ExpandAll(true)
        .ClientEvents(events => events.OnSelect("TreeView_onSelect"))
        .BindTo(Model , map =>
                {
                    map.For<TreeViewBind.Models.Category>(bind => bind.ItemDataBound((item, category) => { item.Text = category.CategoryName; }).Children(category => category.Products));
                    map.For<TreeViewBind.Models.Product>(bind => bind.ItemDataBound((item, product) => { item.Text = product.ProductName;}));
                }        
        )
%>

The above one is the tree that i have created in my project. I want to know that which node the user have Selected in popup. Can somebody tell me how can i find it.

<script type="text/javascript">
        function TreeView_onSelect(e) {
            var treeview = $(this).data('tTreeView');
            var text = ???;
            alert(text);
        }
    </script>
Tags
TreeView
Asked by
Zeb
Top achievements
Rank 1
Share this question
or