0
원격 데이터 바인딩을 사용하여 범주 트리를 표시하려고합니다. 여기KendoUI 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);
}
가
@{
ViewBag.Title = "KendoTree";
}
<h2>KendoTree</h2>
@Html.Kendo().TreeView().Name("Categories").DataSource(dataSource => dataSource
.Read(read => read.Action("KendoTree", "CategoryManagement")
)).DataTextField("Name")
브라우저 트리 대신 JSON 결과 (배열)를 표시 cshtml 파일에게이다 여기 컨트롤러 방법이다.
나는 뭔가를 놓친가요?