Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146642 | Aug 12,2019 01:42 PM UTC | Aug 13,2019 11:50 AM UTC | ASP.NET MVC - EJ 2 | 1 |
![]() |
Tags: Treeview |
<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() |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.