我是这个kendo ui框架和telerik文档的新手,我找不到我正在寻找的解决方案。现在,我使用html助手创建了一个treeview,如下所示,我的要求是,如果我选择一个节点中的任何一个,我必须在右边(或任何地方)获得一个网格,那么我现在所做的代码如下所示
@(Html.Kendo().TreeView()
.Name("treeview") //The name of the treeview is mandatory. It specifies the "id" attribute of the widget.
.Items(items =>
{
items.Add().Text("SystemModelling"); //Add item with text "Item1")
items.Add().Text("SystemConfiguration") //Add item with text "Item2")
.Items(it => it.Add().Text("Root"));
items.Add().Text("Domains"); //Add item with text "Item1")
items.Add().Text("Roles"); //Add item with text "Item2")
items.Add().Text("Users"); //Add item with text "Item1")
})
.Events(ev=>ev.Select("treeview_select"))
)
<script>
$(function () {
// Notice that the Name() of the treeview is used to get its client-side instance
var treeview = $("#treeview").data("kendoTreeView");
});
</script>
在treeview_select
事件中我需要做什么编码?
编辑
ONe简单地怀疑在kendo中哪一种是最好的工作方式,是使用helper还是使用kendo javascript.IF助手是一个包装器,那么助手和javascript之间的区别是什么?
发布于 2014-11-10 13:03:22
您需要在PartialView中创建网格,然后在选择treeView中的节点时读取id:
Index.cshtml
)的右侧,必须创建符合网格的容器,例如:Grid.cshtml
--您正在使用Html.Helper创建网格,比如在这个kendoGrid演示中。Index.html
中的内容,以确保PartialView URL是正确的:
@Html.Hidden("GridURL",Url.Action("Grid","Grid"))https://stackoverflow.com/questions/26843414
复制相似问题