我剛剛開始使用Telerik asp.net mvc,我試圖通過javascript向樹視圖添加一個節點...但我沒有看到任何東西在可能的文檔中。任何人這樣做或者可以指出正確的方向在哪裏找到文檔或例子?TreeView - 通過客戶端動態添加節點
這裏是我用於設置樹視圖的代碼:
@using (Html.BeginForm("Index", "Listings", FormMethod.Post, new { id = "frmListings", name = "frmListings" }))
{
@(Html.Telerik().TreeView()
.Name("topics")
.ClientEvents(e => e.OnSelect("onSelect"))
.BindTo(Model.Topics, mappings => mappings.For<Topic>(binding => binding
.ItemDataBound((item, category) =>
{
item.Text = category.Name;
item.Value = category.URI + "|" + category.Id.ToString();
item.Selected = (Model.CurrentCategory.Id == category.Id);
//item.Expanded = item.Selected;
})
.Children(category => category.Children)
))
)
}
你使用什麼樣的綁定爲TreeView? – 2012-01-09 00:40:06
我相信這是服務器或非AJAX版本... – bbqchickenrobot 2012-01-09 02:40:10