0
リモートデータバインディングでカテゴリのツリーを表示しようとしています。 は、ここでコントローラ方法であってQendoUI for ASPMVC TreeView:ツリーの代わりにJsonレスポンスを表示
public JsonResult KendoTree(Guid? id)
{
var categoriesBO = _categoryManager.GetAllCategory().
Where(c=> id==null ? c.ParentId==null : c.ParentId == id).
Select(c=> new
{
id = c.Id,
Name = c.Name,
hasChildren = c.CategoryChilds.Any()
});
return Json(categoriesBO, JsonRequestBehavior.AllowGet);
}
ここでは、ブラウザは、ツリーの代わりにJSON結果(アレイ)を表示CSHTMLファイル
@{
ViewBag.Title = "KendoTree";
}
<h2>KendoTree</h2>
@Html.Kendo().TreeView().Name("Categories").DataSource(dataSource => dataSource
.Read(read => read.Action("KendoTree", "CategoryManagement")
)).DataTextField("Name")
あります。
何か不足していますか?