<div id="tree">
@Html.Action("DisplayOpenResults1", "Home")
</div> |
public ActionResult DisplayOpenResults1()
{
var tree = treedata.GetTree();
checkboxfields.DataSource = tree;
checkboxfields.HasChildren = "HasChild";
checkboxfields.Expanded = "Expanded";
checkboxfields.Id = "Id";
checkboxfields.ParentID = "PId";
checkboxfields.Text = "Name";
ViewBag.checkboxfields = checkboxfields;
return PartialView("PartialPage");
} |
<div class="col-lg-8 control-section">
<div class="control_wrapper">
@Html.EJS().TreeView("checkbox").ShowCheckBox(true).Fields(ViewBag.checkboxfields).Render()
</div>
</div>
<div class="col-lg-4 property-section">
<table id="property" title="Properties">
<tbody>
<tr>
<td style="padding-right: 10px">
<div style="padding-left: 0;padding-top: 10px">
@Html.EJS().CheckBox("select").Checked(true).Label("Auto Check").Change("onChange").Render()
</div>
</td>
</tr>
</tbody>
</table>
</div>
<script>
function onChange(args) {
var treeObj = document.getElementById('checkbox').ej2_instances[0];
treeObj.autoCheck = args.checked;
}
</script>
@Html.EJS().ScriptManager() |