Skip to content

Commit 60f7bf8

Browse files
Merge pull request #2455 from IgniteUI/teodosiah/add-multiplecascade-to-tree-grid-selection-sample
Add Multiplecascade to TreeGrid selection sample
2 parents d218cdf + 016e178 commit 60f7bf8

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

src/app/tree-grid/tree-grid-selection-sample/tree-grid-selection-sample.component.html

+13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
<igx-snackbar #snackbar actionText="Got it. Thanks!" (clicked)="snackbar.hide()">
66
<div class="container">
77
<igx-icon>notification_important</igx-icon>
8+
<ng-container *ngIf="selectionMode === 'multipleCascade'">
9+
<ul>
10+
<li><b>Now you can select multiple rows within a grid and their children.</b></li>
11+
<li>Click on row selector field or press SPACE key when some cell is active to toggle row
12+
selection.
13+
</li>
14+
<li>On cell click the row get selected and previous selection state is cleared.</li>
15+
<li>On cell click holding ctrl key, the row get selected and previous selection state is
16+
preserved.
17+
</li>
18+
<li>Shift + click select a range of rows.</li>
19+
</ul>
20+
</ng-container>
821
<ng-container *ngIf="selectionMode === 'multiple'">
922
<ul>
1023
<li><b>Now you can select multiple rows within a grid.</b></li>

src/app/tree-grid/tree-grid-selection-sample/tree-grid-selection-sample.component.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
.grid__wrapper {
1111
margin: 0 16px;
1212
}
13-
13+
igx-buttongroup{
14+
width: 500px;
15+
}
1416
igx-snackbar {
1517
position: absolute;
1618
top: 0;

src/app/tree-grid/tree-grid-selection-sample/tree-grid-selection-sample.component.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ export class TreeGridSelectionSampleComponent implements OnInit {
1818

1919
constructor() {
2020
this.data = generateEmployeeFlatData();
21+
2122
this.selectionModes = [
22-
{ label: "none", selected: this.selectionMode === "none", togglable: true },
23-
{ label: "single", selected: this.selectionMode === "single", togglable: true },
24-
{ label: "multiple", selected: this.selectionMode === "multiple", togglable: true }
23+
{ label: "none", selectMode: "none", selected: this.selectionMode === "none", togglable: true },
24+
{ label: "single", selectMode: "single", selected: this.selectionMode === "single", togglable: true },
25+
{ label: "multiple", selectMode: "multiple", selected: this.selectionMode === "multiple", togglable: true },
26+
{ label: "cascade", selectMode: "multipleCascade", selected: this.selectionMode === "multipleCascade", togglable: true }
2527
];
2628
}
2729

@@ -33,7 +35,7 @@ export class TreeGridSelectionSampleComponent implements OnInit {
3335
public handleRowSelection(event) { }
3436

3537
public selectCellSelectionMode(args) {
36-
this.selectionMode = this.selectionModes[args.index].label;
38+
this.selectionMode = this.selectionModes[args.index].selectMode;
3739
this.snackbar.show();
3840
}
3941
}

0 commit comments

Comments
 (0)