我想在TreeView模板中添加Telerik MVC DropDownList,但它不能以这种方式工作: 有谁能告诉我这是什么问题?
<script id="treeTemplate" type="text/kendo-tmpl">
<p>#: item.text #</p>
<p>#=item.id#</p>
<p>
@(Html.Kendo()
.DropDownList()
.Name("Permission_#:item.id#")
.BindTo(Permissionable.GetPermissionTitles())
.DataTextField("Title")
.DataValueField("Permission")
.ToClientTemplate()
)
</p>
@(Html.Kendo().TreeView()
.Name("PAbles")
.TemplateId("treeTemplate")
.HtmlAttributes(new { @class = "tree tree-selectable" })
.BindTo(Model.Permissionables,
mapping => mapping
.For<Permissionable>(binding => binding
.Children(c => c.Childs)
.ItemDataBound((item, c) =>
{
item.Text = c.Title ?? c.Name;
item.Id = c.ID.ToString();
}
)
)
))