Hi I am struggling to figure this out...I am trying to pass additional data on the call. The id that treeview comes up with is always there and correct. But my roleid is always null. And the RoleId is valid number. Running out of places to look so I figured I post...
@(Html.Kendo().TreeView()
.Name("permissionList")
.Checkboxes(true)
.DataTextField("name")
.DataSource(dataSource => dataSource
.Read(read => read.Action("permissions", "roles", new { RoleId = @Model.RoleId}))
)
)
Controller
[HttpGet]
[Route("permissions")]
[Route("permissions/{id}/{RoleId}")]
public JsonResult Permissions(int? id, int? RoleId)
{
var roleFormMgr = new RoleFormMgr(StateMgmt);
var roleEntity = roleFormMgr.GetRole(RoleId.GetValueOrDefault());
var roleFormVM = roleFormMgr.PopulateView(Mapper.Map<RoleForm>(roleEntity));
var permissions = roleFormVM.RolePermissionList.Where(p => id.HasValue ? p.parentId == id : (id == null && p.parentId == 0)).ToList();
return Json(permissions, JsonRequestBehavior.AllowGet);
}