forked from syncfusion/ej2-aspnetmvc-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheckBox.cshtml
85 lines (64 loc) · 2.64 KB
/
CheckBox.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@using Syncfusion.EJ2.Navigations
@using Syncfusion.EJ2
@section ControlsSection{
<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: 0">
@Html.EJS().CheckBox("select").Checked(true).Label("Auto Check").Change("onChange").Render()
</div>
</td>
</tr>
</tbody>
</table>
</div>
@*custom code start*@
<style>
.control_wrapper {
max-width: 500px;
margin: auto;
border: 1px solid #dddddd;
border-radius: 3px;
}
@@media screen and (max-width: 768px) {
.treeview-control-section {
margin: 0;
}
}
</style>
@*custom code end*@
}
@section Meta{
<meta name="description" content="This example demonstrates the CheckBox in ASP.NET MVC TreeView control. Explore here for more details."/>
}
@section ActionDescription{
<div id="action-description">
<p>This sample demonstrates the CheckBox functionalities of the TreeView. Click on any parent node's CheckBox to check/uncheck the node and its child nodes. The parent node's checked state will be determined by its child nodes checked state.</p>
</div>
}
@section Description{
<div id="description">
<p>The <code>TreeView</code> component can be rendered with checkbox on the left side of each tree node. This allows the user to check more than one nodes, and this can be enabled by the <code>showCheckBox</code> property.</p>
<p>In this demo, the TreeView is populated with checkbox enabled.</p>
<p>For more information, you can refer to the <a href="https://ej2.syncfusion.com/aspnetmvc/documentation/treeview/check-box/" target="_blank">Checkboxes</a> section from the documentation.</p>
</div>
}
<script>
function onChange(args) {
var treeObj = document.getElementById('checkbox').ej2_instances[0];
treeObj.autoCheck = args.checked;
}
</script>
@section Title{
<title>ASP.NET MVC TreeView CheckBox Example - Syncfusion Demos </title>
}
@section Header{
<h1 class='sb-sample-text'>Example of CheckBox in ASP.NET MVC TreeView Control</h1>
}