Skip to content

Commit 7b774f5

Browse files
Merge pull request #4685 from Syncfusion-Content/hotfix/hotfix-v31.2.12
DOCINFRA-2341_merged_using_automation
2 parents ea3e303 + fc4d02e commit 7b774f5

File tree

14 files changed

+666
-0
lines changed

14 files changed

+666
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@model List<object>
2+
3+
@Html.EJS().TreeView("listdata").Fields(field=>
4+
field.Id("id").ParentID("pid").Selected("selected").
5+
Expanded("expanded").Text("name").HasChildren("hasChild").HtmlAttributes("htmlAttributes")
6+
.DataSource(Model)).Render()
7+
8+
<style>
9+
.child-node {
10+
font-weight: bold;
11+
}
12+
</style>
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
public IActionResult LocalData()
2+
{
3+
4+
List<object> listdata = new List<object>();
5+
listdata.Add(new
6+
{
7+
id = 1,
8+
name = "Australia",
9+
hasChild = true,
10+
expanded = true
11+
});
12+
listdata.Add(new
13+
{
14+
id = 2,
15+
pid = 1,
16+
name = "New South Wales",
17+
18+
});
19+
listdata.Add(new
20+
{
21+
id = 3,
22+
pid = 1,
23+
name = "Victoria",
24+
HtmlAttributes = new Dictionary<string, string>
25+
{
26+
{ "class", "child-node" }
27+
}
28+
});
29+
30+
listdata.Add(new
31+
{
32+
id = 4,
33+
pid = 1,
34+
name = "South Australia"
35+
});
36+
listdata.Add(new
37+
{
38+
id = 6,
39+
pid = 1,
40+
name = "Western Australia",
41+
42+
});
43+
listdata.Add(new
44+
{
45+
id = 7,
46+
name = "Brazil",
47+
hasChild = true
48+
});
49+
listdata.Add(new
50+
{
51+
id = 8,
52+
pid = 7,
53+
name = "Paraná"
54+
});
55+
listdata.Add(new
56+
{
57+
id = 9,
58+
pid = 7,
59+
name = "Ceará"
60+
});
61+
listdata.Add(new
62+
{
63+
id = 10,
64+
pid = 7,
65+
name = "Acre"
66+
});
67+
listdata.Add(new
68+
{
69+
id = 11,
70+
name = "China",
71+
hasChild = true
72+
});
73+
listdata.Add(new
74+
{
75+
id = 12,
76+
pid = 11,
77+
name = "Guangzhou"
78+
});
79+
listdata.Add(new
80+
{
81+
id = 13,
82+
pid = 11,
83+
name = "Shanghai"
84+
});
85+
listdata.Add(new
86+
{
87+
id = 14,
88+
pid = 11,
89+
name = "Beijing"
90+
});
91+
listdata.Add(new
92+
{
93+
id = 15,
94+
pid = 11,
95+
name = "Shantou"
96+
97+
});
98+
listdata.Add(new
99+
{
100+
id = 16,
101+
name = "France",
102+
hasChild = true
103+
104+
});
105+
listdata.Add(new
106+
{
107+
id = 17,
108+
pid = 16,
109+
name = "Pays de la Loire"
110+
111+
});
112+
listdata.Add(new
113+
{
114+
id = 18,
115+
pid = 16,
116+
name = "Aquitaine"
117+
118+
});
119+
listdata.Add(new
120+
{
121+
id = 19,
122+
pid = 16,
123+
name = "Brittany"
124+
125+
});
126+
listdata.Add(new
127+
{
128+
id = 20,
129+
pid = 16,
130+
name = "Lorraine"
131+
});
132+
listdata.Add(new
133+
{
134+
id = 21,
135+
name = "India",
136+
hasChild = true
137+
138+
});
139+
listdata.Add(new
140+
{
141+
id = 22,
142+
pid = 21,
143+
name = "Assam"
144+
145+
});
146+
listdata.Add(new
147+
{
148+
id = 23,
149+
pid = 21,
150+
name = "Bihar"
151+
});
152+
listdata.Add(new
153+
{
154+
id = 24,
155+
pid = 21,
156+
name = "Tamil Nadu"
157+
158+
});
159+
ViewBag.dataSource = listdata;
160+
return View();
161+
}
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
using Syncfusion.EJ2.Navigations;
2+
3+
public IActionResult LocalData()
4+
{
5+
TreeViewFieldsSettings Listdata = new TreeViewFieldsSettings();
6+
List<object> listdata = new List<object>();
7+
listdata.Add(new
8+
{
9+
id = 1,
10+
name = "Australia",
11+
hasChild = true,
12+
expanded = true
13+
});
14+
listdata.Add(new
15+
{
16+
id = 2,
17+
pid = 1,
18+
name = "New South Wales",
19+
20+
});
21+
listdata.Add(new
22+
{
23+
id = 3,
24+
pid = 1,
25+
name = "Victoria",
26+
HtmlAttributes = new Dictionary<string, string>
27+
{
28+
{ "class", "child-node" }
29+
}
30+
});
31+
32+
listdata.Add(new
33+
{
34+
id = 4,
35+
pid = 1,
36+
name = "South Australia"
37+
});
38+
listdata.Add(new
39+
{
40+
id = 6,
41+
pid = 1,
42+
name = "Western Australia",
43+
44+
});
45+
listdata.Add(new
46+
{
47+
id = 7,
48+
name = "Brazil",
49+
hasChild = true
50+
});
51+
listdata.Add(new
52+
{
53+
id = 8,
54+
pid = 7,
55+
name = "Paraná"
56+
});
57+
listdata.Add(new
58+
{
59+
id = 9,
60+
pid = 7,
61+
name = "Ceará"
62+
});
63+
listdata.Add(new
64+
{
65+
id = 10,
66+
pid = 7,
67+
name = "Acre"
68+
});
69+
listdata.Add(new
70+
{
71+
id = 11,
72+
name = "China",
73+
hasChild = true
74+
});
75+
listdata.Add(new
76+
{
77+
id = 12,
78+
pid = 11,
79+
name = "Guangzhou"
80+
});
81+
listdata.Add(new
82+
{
83+
id = 13,
84+
pid = 11,
85+
name = "Shanghai"
86+
});
87+
listdata.Add(new
88+
{
89+
id = 14,
90+
pid = 11,
91+
name = "Beijing"
92+
});
93+
listdata.Add(new
94+
{
95+
id = 15,
96+
pid = 11,
97+
name = "Shantou"
98+
});
99+
listdata.Add(new
100+
{
101+
id = 16,
102+
name = "France",
103+
hasChild = true
104+
});
105+
listdata.Add(new
106+
{
107+
id = 17,
108+
pid = 16,
109+
name = "Pays de la Loire"
110+
});
111+
listdata.Add(new
112+
{
113+
id = 18,
114+
pid = 16,
115+
name = "Aquitaine"
116+
117+
});
118+
listdata.Add(new
119+
{
120+
id = 19,
121+
pid = 16,
122+
name = "Brittany"
123+
124+
});
125+
listdata.Add(new
126+
{
127+
id = 20,
128+
pid = 16,
129+
name = "Lorraine"
130+
});
131+
listdata.Add(new
132+
{
133+
id = 21,
134+
name = "India",
135+
hasChild = true
136+
});
137+
listdata.Add(new
138+
{
139+
id = 22,
140+
pid = 21,
141+
name = "Assam"
142+
143+
});
144+
listdata.Add(new
145+
{
146+
id = 23,
147+
pid = 21,
148+
name = "Bihar"
149+
});
150+
listdata.Add(new
151+
{
152+
id = 24,
153+
pid = 21,
154+
name = "Tamil Nadu"
155+
});
156+
Listdata.DataSource = listdata;
157+
Listdata.Expanded = "expanded";
158+
Listdata.Id = "id";
159+
Listdata.ParentID = "pid";
160+
Listdata.Text = "name";
161+
Listdata.HasChildren = "hasChild";
162+
ViewBag.TreeViewFields = Listdata;
163+
return View();
164+
}

0 commit comments

Comments
 (0)