Skip to content

Commit d0b479a

Browse files
authored
Merge pull request #3218 from IgniteUI/PMiteva/drop-down-samples-vNext
Add data link to dropdown hierarchical selection samples
2 parents dfbd928 + 8b6efe8 commit d0b479a

5 files changed

Lines changed: 262 additions & 2 deletions

File tree

live-editing/configs/DropDownConfigGenerator.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export class DropDownConfigGenerator implements IConfigGenerator {
126126
}));
127127

128128
configs.push(new Config({
129+
additionalFiles: ['/src/app/data-entries/dropdown/dropdown-tree-hierarchical-selection/countries.ts'],
129130
component: 'DropdownTreeHierarchicalSelectionComponent',
130131
appModuleConfig: new AppModuleConfig({
131132
imports: ['IgxDropDownModule', 'DropdownTreeHierarchicalSelectionComponent',
@@ -137,6 +138,7 @@ export class DropDownConfigGenerator implements IConfigGenerator {
137138
}));
138139

139140
configs.push(new Config({
141+
additionalFiles: ['/src/app/data-entries/dropdown/dropdown-tree-grid-hierarchical-selection/nested-employee-data.ts'],
140142
component: 'DropdownTreeGridHierarchicalSelectionComponent',
141143
appModuleConfig: new AppModuleConfig({
142144
imports: ['IgxDropDownModule', 'DropdownTreeGridHierarchicalSelectionComponent',

src/app/data-entries/dropdown/dropdown-tree-grid-hierarchical-selection/dropdown-tree-grid-hierarchical-selection.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, OnInit, ViewChild } from '@angular/core';
22
import { IBaseChipEventArgs, IgxTreeGridComponent, IRowSelectionEventArgs } from 'igniteui-angular';
33
import { IBaseCancelableBrowserEventArgs } from 'igniteui-angular/lib/core/utils';
4-
import { EMPLOYEE_DATA } from '../../../data/nested-employee-data';
4+
import { EMPLOYEE_DATA } from './nested-employee-data';
55
@Component({
66
// tslint:disable-next-line:component-selector
77
selector: 'app-dropdown-tree-grid-hierarchical-selection',
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/*eslint-disable*/
2+
export const EMPLOYEE_DATA = [
3+
{
4+
Age: 55,
5+
Employees: [
6+
{
7+
Age: 43,
8+
HireDate: new Date(2011, 6, 3),
9+
ID: 3,
10+
Name: "Michael Burke",
11+
Title: "Senior Software Developer"
12+
},
13+
{
14+
Age: 29,
15+
HireDate: new Date(2009, 6, 19),
16+
ID: 2,
17+
Name: "Thomas Anderson",
18+
Title: "Senior Software Developer"
19+
},
20+
{
21+
Age: 31,
22+
HireDate: new Date(2014, 8, 18),
23+
ID: 11,
24+
Name: "Monica Reyes",
25+
Title: "Software Development Team Lead"
26+
},
27+
{
28+
Age: 35,
29+
HireDate: new Date(2015, 9, 17),
30+
ID: 6,
31+
Name: "Roland Mendel",
32+
Title: "Senior Software Developer"
33+
}],
34+
HireDate: new Date(2008, 3, 20),
35+
ID: 1,
36+
Name: "John Winchester",
37+
Title: "Development Manager"
38+
},
39+
{
40+
Age: 42,
41+
Employees: [
42+
{
43+
Age: 44,
44+
HireDate: new Date(2014, 4, 4),
45+
ID: 14,
46+
Name: "Laurence Johnson",
47+
Title: "Director"
48+
},
49+
{
50+
Age: 25,
51+
HireDate: new Date(2017, 11, 9),
52+
ID: 5,
53+
Name: "Elizabeth Richards",
54+
Title: "Vice President"
55+
},
56+
{
57+
Age: 39,
58+
HireDate: new Date(2010, 3, 22),
59+
ID: 13,
60+
Name: "Trevor Ashworth",
61+
Title: "Director"
62+
}],
63+
HireDate: new Date(2014, 1, 22),
64+
ID: 4,
65+
Name: "Ana Sanders",
66+
Title: "CEO"
67+
},
68+
{
69+
Age: 49,
70+
Employees: [],
71+
HireDate: new Date(2014, 1, 22),
72+
ID: 18,
73+
Name: "Victoria Lincoln",
74+
Title: "Senior Accountant"
75+
},
76+
{
77+
Age: 61,
78+
Employees: [],
79+
HireDate: new Date(2010, 1, 1),
80+
ID: 10,
81+
Name: "Yang Wang",
82+
Title: "Localization Developer"
83+
},
84+
{
85+
Age: 35,
86+
Employees: [],
87+
HireDate: new Date(2014, 1, 22),
88+
ID: 35,
89+
Name: "Janine Munoz",
90+
Title: "HR"
91+
},
92+
{
93+
Age: 49,
94+
Employees: [],
95+
HireDate: new Date(2010, 1, 1),
96+
ID: 10,
97+
Name: "Yang Wang",
98+
Title: "Sales Manager"
99+
}
100+
];
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/* eslint-disable @typescript-eslint/naming-convention */
2+
export const COUNTRIES: any[] = [
3+
{
4+
ID: 1,
5+
Name: 'UK',
6+
Cities: [
7+
{
8+
ID: 11,
9+
Name: 'London',
10+
Population: 8294058
11+
},
12+
{
13+
ID: 12,
14+
Name: 'Liverpool',
15+
Population: 830112
16+
},
17+
{
18+
ID: 13,
19+
Name: 'Manchester',
20+
Population: 1741961
21+
},
22+
{
23+
ID: 14,
24+
Name: 'Birmingham',
25+
Population: 2293099
26+
},
27+
{
28+
ID: 15,
29+
Name: 'Leeds',
30+
Population: 750700
31+
},
32+
{
33+
ID: 16,
34+
Name: 'Sheffield',
35+
Population: 551800
36+
}
37+
]
38+
},
39+
{
40+
ID: 2,
41+
Name: 'France',
42+
Cities: [
43+
{
44+
ID: 21,
45+
Name: 'Paris',
46+
Population: 2181371
47+
},
48+
{
49+
ID: 22,
50+
Name: 'Marseille',
51+
Population: 839043
52+
},
53+
{
54+
ID: 23,
55+
Name: 'Lyon',
56+
Population: 472305
57+
},
58+
{
59+
ID: 24,
60+
Name: 'Toulouse',
61+
Population: 437715
62+
}
63+
]
64+
},
65+
{
66+
ID: 3,
67+
Name: 'Germany',
68+
Cities: [
69+
{
70+
ID: 31,
71+
Name: 'Berlin',
72+
Population: 3292365
73+
},
74+
{
75+
ID: 32,
76+
Name: 'Hamburg',
77+
Population: 1706696
78+
},
79+
{
80+
ID: 33,
81+
Name: 'Munich',
82+
Population: 1348335
83+
},
84+
{
85+
ID: 34,
86+
Name: 'Cologne',
87+
Population: 1005775
88+
},
89+
{
90+
ID: 35,
91+
Name: 'Stuttgart',
92+
Population: 585890
93+
}
94+
]
95+
},
96+
{
97+
ID: 4,
98+
Name: 'Italy',
99+
Cities: [
100+
{
101+
ID: 41,
102+
Name: 'Rome',
103+
Population: 2761632
104+
},
105+
{
106+
ID: 42,
107+
Name: 'Milan',
108+
Population: 1371498
109+
},
110+
{
111+
ID: 43,
112+
Name: 'Naples',
113+
Population: 914758
114+
},
115+
{
116+
ID: 44,
117+
Name: 'Turin',
118+
Population: 848885
119+
},
120+
{
121+
ID: 45,
122+
Name: 'Venice',
123+
Population: 254661
124+
},
125+
{
126+
ID: 46,
127+
Name: 'Florence',
128+
Population: 367150
129+
}
130+
]
131+
},
132+
{
133+
ID: 5,
134+
Name: 'Spain',
135+
Cities: [
136+
{
137+
ID: 51,
138+
Name: 'Madrid',
139+
Population: 6155116
140+
},
141+
{
142+
ID: 52,
143+
Name: 'Barcelona',
144+
Population: 5179243
145+
},
146+
{
147+
ID: 53,
148+
Name: 'Valencia',
149+
Population: 1645342
150+
},
151+
{
152+
ID: 54,
153+
Name: 'Seville',
154+
Population: 1305342
155+
}
156+
]
157+
}
158+
];

src/app/data-entries/dropdown/dropdown-tree-hierarchical-selection/dropdown-tree-hierarchical-selection.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, OnInit, ViewChild } from '@angular/core';
22
import { IBaseChipEventArgs, IgxChipComponent, IgxTreeComponent, ITreeNodeSelectionEvent } from 'igniteui-angular';
33
import { IBaseCancelableBrowserEventArgs } from 'igniteui-angular/lib/core/utils';
4-
import { COUNTRIES } from '../../../data/countries';
4+
import { COUNTRIES } from './countries';
55
@Component({
66
// tslint:disable-next-line:component-selector
77
selector: 'app-dropdown-tree-hierarchical-selection',

0 commit comments

Comments
 (0)