Skip to content

Commit 6c76ff2

Browse files
authored
Merge pull request #3258 from IgniteUI/EWhite/3250-grid-samples-height
fix(hierarchical grid): add richer data and a few new columns
2 parents 03f2cae + c71d957 commit 6c76ff2

7 files changed

Lines changed: 56 additions & 20 deletions

File tree

src/app/data/hierarchical-data.ts

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -395,19 +395,28 @@ export const CUSTOMERS = [{
395395
ProductID: 11,
396396
UnitPrice: 14.0000,
397397
Quantity: 12,
398-
Discount: 0.0000000e+000
398+
Discount: 0.0000000e+000,
399+
Weight: 2.5,
400+
Length: 25.6,
401+
TotalPrice: 225.75
399402
},
400403
{
401404
ProductID: 42,
402405
UnitPrice: 9.8000,
403406
Quantity: 10,
404-
Discount: 0.0000000e+000
407+
Discount: 0.0000000e+000,
408+
Weight: 2.1,
409+
Length: 29.3,
410+
TotalPrice: 250.50
405411
},
406412
{
407413
ProductID: 72,
408414
UnitPrice: 34.8000,
409415
Quantity: 5,
410-
Discount: 0.0000000e+000
416+
Discount: 0.0000000e+000,
417+
Weight: 2.7,
418+
Length: 24.8,
419+
TotalPrice: 220.25
411420
}
412421
]
413422
}]
@@ -440,12 +449,18 @@ export const CUSTOMERS = [{
440449
ProductID: 14,
441450
UnitPrice: 18.6000,
442451
Quantity: 9,
443-
Discount: 0.0000000e+000
452+
Discount: 0.0000000e+000,
453+
Weight: 3.2,
454+
Length: 28.6,
455+
TotalPrice: 253.75
444456
}, {
445457
ProductID: 51,
446458
UnitPrice: 42.4000,
447459
Quantity: 40,
448-
Discount: 0.0000000e+000
460+
Discount: 0.0000000e+000,
461+
Weight: 2.5,
462+
Length: 25.6,
463+
TotalPrice: 225.75
449464
}]
450465
}]
451466
}, {
@@ -478,17 +493,26 @@ export const CUSTOMERS = [{
478493
ProductID: 41,
479494
UnitPrice: 7.7000,
480495
Quantity: 10,
481-
Discount: 0.0000000e+000
496+
Discount: 0.0000000e+000,
497+
Weight: 2.9,
498+
Length: 26.9,
499+
TotalPrice: 233.50
482500
}, {
483501
ProductID: 51,
484502
UnitPrice: 42.4000,
485503
Quantity: 35,
486-
Discount: 1.5000001e-001
504+
Discount: 1.5000001e-001,
505+
Weight: 3.5,
506+
Length: 27.4,
507+
TotalPrice: 261.25
487508
}, {
488509
ProductID: 65,
489510
UnitPrice: 16.8000,
490511
Quantity: 15,
491-
Discount: 1.5000001e-001
512+
Discount: 1.5000001e-001,
513+
Weight: 2.2,
514+
Length: 30.2,
515+
TotalPrice: 249.75
492516
}]
493517
}]
494518
}, {
@@ -519,17 +543,26 @@ export const CUSTOMERS = [{
519543
ProductID: 22,
520544
UnitPrice: 16.8000,
521545
Quantity: 6,
522-
Discount: 5.0000001e-002
546+
Discount: 5.0000001e-002,
547+
Weight: 2.6,
548+
Length: 26.8,
549+
TotalPrice: 226.50
523550
}, {
524551
ProductID: 57,
525552
UnitPrice: 15.6000,
526553
Quantity: 15,
527-
Discount: 5.0000001e-002
554+
Discount: 5.0000001e-002,
555+
Weight: 3.1,
556+
Length: 24.3,
557+
TotalPrice: 219.25
528558
}, {
529559
ProductID: 65,
530560
UnitPrice: 16.8000,
531561
Quantity: 20,
532-
Discount: 0.0000000e+000
562+
Discount: 0.0000000e+000,
563+
Weight: 2.4,
564+
Length: 23.7,
565+
TotalPrice: 207.00
533566
}]
534567
}]
535568
}, {

src/app/grid/grid-sample-pinning/grid-toolbar-pinning.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div [ngClass]="{'grid__wrapper': true, 'dark-theme': dark === true }" style='width: 100%;'>
1+
<div [ngClass]="{'grid__wrapper': true, 'dark-theme': useDarkTheme }" style='width: 100%;'>
22
<igx-grid [igxPreventDocumentScroll]="true" #grid1 [data]="data" [width]="'100%'" [height]="'480px'">
33
<igx-grid-toolbar>
44
<igx-grid-toolbar-actions>

src/app/grid/grid-sample-pinning/grid-toolbar-pinning.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ActivatedRoute } from '@angular/router';
1515
export class PinningToolbarSampleComponent implements OnInit{
1616
@ViewChild('grid1', { static: true }) public grid1: IgxGridComponent;
1717

18-
public dark = false;
18+
public useDarkTheme: boolean = false;
1919
public data: any[];
2020
public columns: any[];
2121

@@ -36,7 +36,7 @@ export class PinningToolbarSampleComponent implements OnInit{
3636
this.data = DATA;
3737

3838
this.activatedRoute.queryParams.subscribe(params => {
39-
this.dark = !!params.dark;
39+
this.useDarkTheme = params.dark === 'true';
4040
});
4141
}
4242

src/app/hierarchical-grid/hierarchical-grid-column-pinning/hierarchical-grid-toolbar-pinning.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div [ngClass]="{'grid__wrapper': true, 'dark-theme': dark === true }">
1+
<div [ngClass]="{'grid__wrapper': true, 'dark-theme': useDarkTheme }">
22
<igx-hierarchical-grid [igxPreventDocumentScroll]="true" class="hierarchicalGrid" [data]="localdata" [autoGenerate]="false"
33
[height]="'100%'" [width]="'100%'" #hierarchicalGrid>
44
<igx-grid-toolbar>
@@ -31,6 +31,9 @@
3131
<igx-column field="UnitPrice" header="Unit Price" width="150px"></igx-column>
3232
<igx-column field="Quantity" width="150px"></igx-column>
3333
<igx-column field="Discount" width="150px"></igx-column>
34+
<igx-column field="Weight" width="150px"></igx-column>
35+
<igx-column field="Length" width="150px"></igx-column>
36+
<igx-column field="TotalPrice" width="150px"></igx-column>
3437
</igx-row-island>
3538
</igx-row-island>
3639
</igx-hierarchical-grid>

src/app/hierarchical-grid/hierarchical-grid-column-pinning/hierarchical-grid-toolbar-pinning.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import { ActivatedRoute } from '@angular/router';
99
})
1010
export class HGridToolbarPinningComponent implements OnInit {
1111
public localdata;
12-
public dark = false;
12+
public useDarkTheme: boolean = false;
1313

1414
constructor(private activatedRoute: ActivatedRoute) {
1515
this.localdata = CUSTOMERS;
1616
}
1717

1818
public ngOnInit(): void {
1919
this.activatedRoute.queryParams.subscribe(params => {
20-
this.dark = !!params.dark;
20+
this.useDarkTheme = params.dark === 'true';
2121
});
2222
}
2323

src/app/tree-grid/tree-grid-column-pinning-sample/tree-grid-toolbar-pinning.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div [ngClass]="{'grid__wrapper': true, 'dark-theme': dark === true }">
1+
<div [ngClass]="{'grid__wrapper': true, 'dark-theme': useDarkTheme }">
22
<igx-tree-grid [igxPreventDocumentScroll]="true" #treeGrid [data]="data" primaryKey="ID" foreignKey="ParentID" [autoGenerate]="false" height="600px"
33
width="100%">
44
<igx-grid-toolbar>

src/app/tree-grid/tree-grid-column-pinning-sample/tree-grid-toolbar-pinning.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ import { ActivatedRoute } from '@angular/router';
1414
export class TreeGridPinningToolbarSampleComponent implements OnInit {
1515
@ViewChild('treeGrid', { static: true }) public treeGrid: IgxTreeGridComponent;
1616
public data: any[];
17-
public dark = false;
17+
public useDarkTheme: boolean = false;
1818

1919
constructor(private activatedRoute: ActivatedRoute) {
2020
this.data = generateEmployeeDetailedFlatData();
2121
}
2222

2323
public ngOnInit(): void {
2424
this.activatedRoute.queryParams.subscribe(params => {
25-
this.dark = !!params.dark;
25+
this.useDarkTheme = params.dark === 'true';
2626
});
2727
}
2828
}

0 commit comments

Comments
 (0)