this is the code where i create tree in telerik mvc. Now i want to create popup which shows the slected node name.
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;}));
}
)
Here is the javascript code.
function TreeView_onSelect(e)
{
var treeview = $(this).data('tTreeView');
alert("You select the node " + ...);
}
to get a node's text:
function TreeView_onSelect(e)
{
var treeview = $(this).data('tTreeView');
var nodeText = treeview.getItemText(e.item);
alert("You select the node: " + nodeText);
}
Regards
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.