If I have a treeview with .DataSource(d=>d.Model(....).Read(r=>r.Action(....)))
Can I use .ItemAction() to set item.checked based on a field provided in the DataSource? How?
In the code below, what would I put in place of the bolded comment?
@( Html.Kendo().TreeView()
.DataTextField("Name")
.Name("userPermissionsTree")
.Checkboxes(cbxConfig => cbxConfig.Enabled(true)
.CheckChildren(true)
.Name("checkedNodes"))
.DataSource(d => d.Model(m =>
{
m.Field("enabled");
m.Id("permissionId")
})
.Read(read => read.Action("PermissionsTree_Read",
"SettingsUsers",
new {
userId = Model
})))
.ItemAction(item=>item.Checked= /*******set to true if field enabled is true**********/ )
.Events(events => events
.Check("onPrivilegeCheck"))
)