forked from syncfusion/ej2-aspnetmvc-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTemplate.cshtml
96 lines (80 loc) · 2.69 KB
/
Template.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
86
87
88
89
90
91
92
93
94
95
96
@using Syncfusion.EJ2.Navigations
@using Syncfusion.EJ2
@section ControlsSection{
<div class="control-section">
<div class="control_wrapper">
@Html.EJS().TreeView("template").NodeTemplate("#treeTemplate").Fields(ViewBag.templatefields).Render()
</div>
</div>
@*custom code start*@
<style>
.control_wrapper {
max-width: 320px;
margin: auto;
border: 1px solid #dddddd;
border-radius: 3px;
}
.e-treeview .e-list-text {
width: 100%;
}
.treeCount.e-badge {
padding: 0.4em;
vertical-align: text-bottom;
}
.material .treeCount.e-badge {
vertical-align: middle;
}
.nodetext {
float: left;
}
.e-rtl .nodetext {
float: right;
}
.nodebadge {
float: right;
margin-right: 5px
}
.e-rtl .nodebadge {
float: left;
margin-left: 5px
}
</style>
@*custom code end*@
}
@section PreScripts {
<script id="treeTemplate" type="text/x-template">
<div>
<div class="treeviewdiv">
<div class="nodetext">
<span class="treeName">${name}</span>
</div>
${if(count)}
<div class="nodebadge">
<span class="treeCount e-badge e-badge-primary">${count}</span>
</div>
${/if}
</div>
</div>
</script>
}
@section Meta{
<meta name="description" content="This example demonstrates the Template in ASP.NET MVC TreeView control. Explore here for more details."/>
}
@section ActionDescription{
<div id="action-description">
<p>This sample demonstrates the template functionalities of the TreeView. Select the root node by clicking on it, or expand the root node and select the customized child node.</p>
</div>
}
@section Description{
<div id="description">
<p>The <code>TreeView</code> component has an option to customize the node structure through the <code>nodeTemplate</code> property, so that the tree node can be formed with any custom structure.</p>
<p>In this demo, the node is formed as like webmail with folder name and number of unread messages.</p>
<p>For more information, you can refer to the <a href="https://ej2.syncfusion.com/aspnetmvc/documentation/treeview/template/" target="_blank">Templates</a> section from the documentation.</p>
</div>
}
@section Title{
<title>ASP.NET MVC TreeView Template Example - Syncfusion Demos </title>
}
@section Header{
<h1 class='sb-sample-text'>Example of Template in ASP.NET MVC TreeView Control</h1>
}