Skip to content

Commit 2a02641

Browse files
committed
fix(hierarchical grid): add richer data and a few new columns
1 parent 30faf20 commit 2a02641

3 files changed

Lines changed: 51 additions & 14 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/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': dark === 'true' }">
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ import { ActivatedRoute } from '@angular/router';
99
})
1010
export class HGridToolbarPinningComponent implements OnInit {
1111
public localdata;
12-
public dark = false;
12+
public dark = "";
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+
console.log(this.activatedRoute.queryParams);
21+
this.dark = params.dark;
2122
});
2223
}
2324

0 commit comments

Comments
 (0)