Skip to content

Commit 4070cea

Browse files
committed
chore(*): update sample with all column types
1 parent 790f1d4 commit 4070cea

File tree

2 files changed

+89
-26
lines changed

2 files changed

+89
-26
lines changed

src/app/grid-export/grid-export.sample.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ <h4 class="sample-title">Grid Export</h4>
3434
<igx-icon class="header-icon" style.color="{{ col.hasSummary ? '#e41c77' : '' }}" (click)="toggleSummary(col)">functions</igx-icon>
3535
</ng-template>
3636
</igx-column>
37-
<igx-column #col field="Discontinued" header="Discontinued" [hasSummary]="true" [dataType]="'boolean'" [groupable]='true'>
38-
<ng-template igxCell let-cell="cell" let-val>
39-
<img *ngIf="val" src="assets/images/grid/active.png" title="Continued" alt="Continued" />
40-
<img *ngIf="!val" src="assets/images/grid/expired.png" title="Discontinued" alt="Discontinued" />
41-
</ng-template>
42-
</igx-column>
37+
<igx-column #col field="PercentInStock" [dataType]="'percent'"></igx-column>
38+
<igx-column #col field="ProductionDate" [dataType]="'dateTime'"></igx-column>
39+
<igx-column #col field="PackagedAt" [dataType]="'time'"></igx-column>
4340
<igx-column #col field="OrderDate" [dataType]="'date'" [hasSummary]="true">
4441
<ng-template igxCell let-cell="cell" let-val let-row>
4542
{{ val | date: 'MMM d, yyyy' }}
@@ -49,6 +46,12 @@ <h4 class="sample-title">Grid Export</h4>
4946
<igx-icon class="header-icon" style.color="{{ col.hasSummary ? '#e41c77' : '' }}" (click)="toggleSummary(col)">functions</igx-icon>
5047
</ng-template>
5148
</igx-column>
49+
<igx-column #col field="Discontinued" header="Discontinued" [hasSummary]="true" [dataType]="'boolean'" [groupable]='true'>
50+
<ng-template igxCell let-cell="cell" let-val>
51+
<img *ngIf="val" src="assets/images/grid/active.png" title="Continued" alt="Continued" />
52+
<img *ngIf="!val" src="assets/images/grid/expired.png" title="Discontinued" alt="Discontinued" />
53+
</ng-template>
54+
</igx-column>
5255
</igx-grid>
5356

5457
<h4 class="sample-title">Tree Grid Export</h4>

src/app/grid-export/gridData.ts

Lines changed: 80 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export const GRID_DATA: any[] = [{
1010
UnitsOnOrder: 30,
1111
ReorderLevel: 10,
1212
Discontinued: false,
13-
OrderDate: new Date("2012-02-12")
13+
OrderDate: new Date("2012-02-12"),
14+
ProductionDate: new Date("2011-02-12 10:15:35"),
15+
PackagedAt: new Date("2011-02-12 10:15:35"),
16+
PercentInStock: 0.6807
1417
}, {
1518
ProductID: 2,
1619
ProductName: "Chang",
@@ -22,7 +25,10 @@ export const GRID_DATA: any[] = [{
2225
UnitsOnOrder: 40,
2326
ReorderLevel: 25,
2427
Discontinued: true,
25-
OrderDate: new Date("2003-03-17")
28+
OrderDate: new Date("2003-03-17"),
29+
ProductionDate: new Date("2002-03-17 13:35:25"),
30+
PackagedAt: new Date("2002-03-17 13:35:25"),
31+
PercentInStock: 0.7006
2632
}, {
2733
ProductID: 3,
2834
ProductName: "Aniseed Syrup",
@@ -34,7 +40,10 @@ export const GRID_DATA: any[] = [{
3440
UnitsOnOrder: 70,
3541
ReorderLevel: 25,
3642
Discontinued: false,
37-
OrderDate: new Date("2006-03-17")
43+
OrderDate: new Date("2006-03-17"),
44+
ProductionDate: new Date("2005-03-17 12:16:33"),
45+
PackagedAt: new Date("2005-03-17 12:16:33"),
46+
PercentInStock: 0.1634
3847
}, {
3948
ProductID: 4,
4049
ProductName: "Chef Antons Cajun Seasoning",
@@ -46,7 +55,10 @@ export const GRID_DATA: any[] = [{
4655
UnitsOnOrder: 30,
4756
ReorderLevel: 0,
4857
Discontinued: false,
49-
OrderDate: new Date("2016-03-17")
58+
OrderDate: new Date("2016-03-17"),
59+
ProductionDate: new Date("2015-03-17 13:24:28"),
60+
PackagedAt: new Date("2015-03-17 13:24:28"),
61+
PercentInStock: 0.7523
5062
}, {
5163
ProductID: 5,
5264
ProductName: "Chef Antons Gumbo Mix",
@@ -58,7 +70,10 @@ export const GRID_DATA: any[] = [{
5870
UnitsOnOrder: 30,
5971
ReorderLevel: 0,
6072
Discontinued: true,
61-
OrderDate: new Date("2011-11-11")
73+
OrderDate: new Date("2011-11-11"),
74+
ProductionDate: new Date("2010-11-11 09:15:25"),
75+
PackagedAt: new Date("2010-11-11 09:15:25"),
76+
PercentInStock: 0.5
6277
}, {
6378
ProductID: 6,
6479
ProductName: "Grandmas Boysenberry Spread",
@@ -70,7 +85,10 @@ export const GRID_DATA: any[] = [{
7085
UnitsOnOrder: 30,
7186
ReorderLevel: 25,
7287
Discontinued: false,
73-
OrderDate: new Date("2017-12-17")
88+
OrderDate: new Date("2017-12-17"),
89+
ProductionDate: new Date("2016-12-17 10:10:30"),
90+
PackagedAt: new Date("2016-12-17 10:10:30"),
91+
PercentInStock: 0.5642
7492
}, {
7593
ProductID: 7,
7694
ProductName: "Uncle Bobs Organic Dried Pears",
@@ -82,7 +100,10 @@ export const GRID_DATA: any[] = [{
82100
UnitsOnOrder: 30,
83101
ReorderLevel: 10,
84102
Discontinued: false,
85-
OrderDate: new Date("2016-07-17")
103+
OrderDate: new Date("2016-07-17"),
104+
ProductionDate: new Date("2015-07-17 11:11:11"),
105+
PackagedAt: new Date("2015-07-17 11:11:11"),
106+
PercentInStock: 0.1707
86107
}, {
87108
ProductID: 8,
88109
ProductName: "Northwoods Cranberry Sauce",
@@ -94,7 +115,10 @@ export const GRID_DATA: any[] = [{
94115
UnitsOnOrder: 30,
95116
ReorderLevel: 0,
96117
Discontinued: false,
97-
OrderDate: new Date("2018-01-17")
118+
OrderDate: new Date("2018-01-17"),
119+
ProductionDate: new Date("2017-01-17 12:12:32"),
120+
PackagedAt: new Date("2017-01-17 12:12:32"),
121+
PercentInStock: 0.0717
98122
}, {
99123
ProductID: 9,
100124
ProductName: "Mishi Kobe Niku",
@@ -106,7 +130,10 @@ export const GRID_DATA: any[] = [{
106130
UnitsOnOrder: 30,
107131
ReorderLevel: 0,
108132
Discontinued: true,
109-
OrderDate: new Date("2010-02-17")
133+
OrderDate: new Date("2010-02-17"),
134+
ProductionDate: new Date("2009-02-17 15:16:35"),
135+
PackagedAt: new Date("2009-02-17 15:16:35"),
136+
PercentInStock: 0.1219
110137
}, {
111138
ProductID: 10,
112139
ProductName: "Ikura",
@@ -118,7 +145,10 @@ export const GRID_DATA: any[] = [{
118145
UnitsOnOrder: 30,
119146
ReorderLevel: 0,
120147
Discontinued: false,
121-
OrderDate: new Date("2008-05-17")
148+
OrderDate: new Date("2008-05-17"),
149+
ProductionDate: new Date("2007-05-17 19:29:35"),
150+
PackagedAt: new Date("2007-05-17 19:29:35"),
151+
PercentInStock: 0.9812
122152
}, {
123153
ProductID: 11,
124154
ProductName: "Queso Cabrales",
@@ -130,7 +160,10 @@ export const GRID_DATA: any[] = [{
130160
UnitsOnOrder: 30,
131161
ReorderLevel: 30,
132162
Discontinued: false,
133-
OrderDate: new Date("2009-01-17")
163+
OrderDate: new Date("2009-01-17"),
164+
ProductionDate: new Date("2008-01-17 17:17:35"),
165+
PackagedAt: new Date("2008-01-17 17:17:35"),
166+
PercentInStock: 0.1912
134167
}, {
135168
ProductID: 12,
136169
ProductName: "Queso Manchego La Pastora",
@@ -142,7 +175,10 @@ export const GRID_DATA: any[] = [{
142175
UnitsOnOrder: 30,
143176
ReorderLevel: 0,
144177
Discontinued: false,
145-
OrderDate: new Date("2015-11-17")
178+
OrderDate: new Date("2015-11-17"),
179+
ProductionDate: new Date("2014-11-17 15:25:35"),
180+
PackagedAt: new Date("2014-11-17 15:25:35"),
181+
PercentInStock: 0.1717
146182
}, {
147183
ProductID: 13,
148184
ProductName: "Konbu",
@@ -154,7 +190,10 @@ export const GRID_DATA: any[] = [{
154190
UnitsOnOrder: 30,
155191
ReorderLevel: 5,
156192
Discontinued: false,
157-
OrderDate: new Date("2015-03-17")
193+
OrderDate: new Date("2015-03-17"),
194+
ProductionDate: new Date("2014-03-17 03:05:35"),
195+
PackagedAt: new Date("2014-03-17 03:05:35"),
196+
PercentInStock: 0.3788
158197
}, {
159198
ProductID: 14,
160199
ProductName: "Tofu",
@@ -166,7 +205,10 @@ export const GRID_DATA: any[] = [{
166205
UnitsOnOrder: 30,
167206
ReorderLevel: 0,
168207
Discontinued: false,
169-
OrderDate: new Date("2017-06-17")
208+
OrderDate: new Date("2017-06-17"),
209+
ProductionDate: new Date("2016-06-17 05:03:35"),
210+
PackagedAt: new Date("2016-06-17 05:03:35"),
211+
PercentInStock: 0.0128
170212
}, {
171213
ProductID: 15,
172214
ProductName: "Genen Shouyu",
@@ -178,7 +220,10 @@ export const GRID_DATA: any[] = [{
178220
UnitsOnOrder: 30,
179221
ReorderLevel: 5,
180222
Discontinued: false,
181-
OrderDate: new Date("2014-03-17")
223+
OrderDate: new Date("2014-03-17"),
224+
ProductionDate: new Date("2013-03-17 06:15:25"),
225+
PackagedAt: new Date("2013-03-17 06:15:25"),
226+
PercentInStock: 0.892
182227
}, {
183228
ProductID: 16,
184229
ProductName: "Pavlova",
@@ -190,7 +235,10 @@ export const GRID_DATA: any[] = [{
190235
UnitsOnOrder: 30,
191236
ReorderLevel: 10,
192237
Discontinued: false,
193-
OrderDate: new Date("2018-03-28")
238+
OrderDate: new Date("2018-03-28"),
239+
ProductionDate: new Date("2017-03-28 08:17:35"),
240+
PackagedAt: new Date("2017-03-28 08:17:35"),
241+
PercentInStock: 0.9124
194242
}, {
195243
ProductID: 17,
196244
ProductName: "Alice Mutton",
@@ -202,7 +250,10 @@ export const GRID_DATA: any[] = [{
202250
UnitsOnOrder: 30,
203251
ReorderLevel: 0,
204252
Discontinued: true,
205-
OrderDate: new Date("2015-08-17")
253+
OrderDate: new Date("2015-08-17 10:15:35"),
254+
ProductionDate: new Date("2014-08-17 16:15:35"),
255+
PackagedAt: new Date("2014-08-17 16:15:35"),
256+
PercentInStock: 0.2634
206257
}, {
207258
ProductID: 18,
208259
ProductName: "Carnarvon Tigers",
@@ -214,7 +265,10 @@ export const GRID_DATA: any[] = [{
214265
UnitsOnOrder: 30,
215266
ReorderLevel: 0,
216267
Discontinued: false,
217-
OrderDate: new Date("2005-09-27")
268+
OrderDate: new Date("2005-09-27"),
269+
ProductionDate: new Date("2004-09-27 16:48:35"),
270+
PackagedAt: new Date("2004-09-27 16:48:35"),
271+
PercentInStock: 0.4632
218272
}, {
219273
ProductID: 19,
220274
ProductName: "Teatime Chocolate Biscuits",
@@ -226,7 +280,10 @@ export const GRID_DATA: any[] = [{
226280
UnitsOnOrder: 30,
227281
ReorderLevel: 5,
228282
Discontinued: false,
229-
OrderDate: new Date("2001-03-17")
283+
OrderDate: new Date("2001-03-17"),
284+
ProductionDate: new Date("2000-03-17 14:34:35"),
285+
PackagedAt: new Date("2000-03-17 14:34:35"),
286+
PercentInStock: 0.069
230287
}, {
231288
ProductID: 20,
232289
ProductName: "Sir Rodneys Marmalade",
@@ -238,7 +295,10 @@ export const GRID_DATA: any[] = [{
238295
UnitsOnOrder: 30,
239296
ReorderLevel: 0,
240297
Discontinued: false,
241-
OrderDate: new Date("2005-03-17")
298+
OrderDate: new Date("2005-03-17"),
299+
ProductionDate: new Date("2004-03-17 11:17:35"),
300+
PackagedAt: new Date("2004-03-17 11:17:35"),
301+
PercentInStock: 0.234,
242302
}
243303
];
244304
/* tslint:enable */

0 commit comments

Comments
 (0)