Skip to content

Add Multiplecascade to TreeGrid selection sample #2455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
<igx-snackbar #snackbar actionText="Got it. Thanks!" (clicked)="snackbar.hide()">
<div class="container">
<igx-icon>notification_important</igx-icon>
<ng-container *ngIf="selectionMode === 'multipleCascade'">
<ul>
<li><b>Now you can select multiple rows within a grid and their children.</b></li>
<li>Click on row selector field or press SPACE key when some cell is active to toggle row
selection.
</li>
<li>On cell click the row get selected and previous selection state is cleared.</li>
<li>On cell click holding ctrl key, the row get selected and previous selection state is
preserved.
</li>
<li>Shift + click select a range of rows.</li>
</ul>
</ng-container>
<ng-container *ngIf="selectionMode === 'multiple'">
<ul>
<li><b>Now you can select multiple rows within a grid.</b></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
.grid__wrapper {
margin: 0 16px;
}

igx-buttongroup{
width: 500px;
}
igx-snackbar {
position: absolute;
top: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ export class TreeGridSelectionSampleComponent implements OnInit {

constructor() {
this.data = generateEmployeeFlatData();

this.selectionModes = [
{ label: "none", selected: this.selectionMode === "none", togglable: true },
{ label: "single", selected: this.selectionMode === "single", togglable: true },
{ label: "multiple", selected: this.selectionMode === "multiple", togglable: true }
{ label: "none", selectMode: "none", selected: this.selectionMode === "none", togglable: true },
{ label: "single", selectMode: "single", selected: this.selectionMode === "single", togglable: true },
{ label: "multiple", selectMode: "multiple", selected: this.selectionMode === "multiple", togglable: true },
{ label: "cascade", selectMode: "multipleCascade", selected: this.selectionMode === "multipleCascade", togglable: true }
];
}

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

public selectCellSelectionMode(args) {
this.selectionMode = this.selectionModes[args.index].label;
this.selectionMode = this.selectionModes[args.index].selectMode;
this.snackbar.show();
}
}