在TreeView模板中添加Telerik MVC DropDownList

时间:2014-11-19 10:17:09

标签: telerik kendo-template

我想在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();
            }
        )
    )
))

0 个答案:

没有答案