Skip to content

Commit ad0fa6d

Browse files
committed
feat(igxTreeGrid): Makes body instance of pinned row unselectable #6640
1 parent b231b10 commit ad0fa6d

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid-row.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
<div class="igx-grid__cbx-padding">
7575
<igx-checkbox
7676
[readonly]="true"
77-
[checked]="selected"
78-
[disabled]="deleted"
77+
[checked]="selected && !pinnedBodyInstance"
78+
[disabled]="deleted || pinnedBodyInstance"
7979
disableRipple="true"
8080
[disableTransitions]="grid.disableTransitions"
8181
[aria-label]="rowCheckboxAriaLabel">

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid-row.component.ts

+19-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export class IgxTreeGridRowComponent extends IgxRowDirective<IgxTreeGridComponen
2424
@ViewChildren('treeCell')
2525
public cells: QueryList<any>;
2626

27+
/**
28+
* @hidden
29+
*/
30+
@Input()
31+
@HostBinding('attr.aria-selected')
32+
get selected(): boolean {
33+
return !this.pinnedBodyInstance && this.selectionService.isRowSelected(this.rowID);
34+
}
35+
2736
/**
2837
* The `ITreeGridRecord` passed to the row component.
2938
*
@@ -56,6 +65,15 @@ export class IgxTreeGridRowComponent extends IgxRowDirective<IgxTreeGridComponen
5665
return this.grid.isRowInPinnedRecordsStructure(this._treeRow);
5766
}
5867

68+
/**
69+
* Gets whether the current row is pinned and is in the grid's body,
70+
* and not in the grid's pinned area.
71+
* @hidden @internal
72+
*/
73+
public get pinnedBodyInstance(): boolean {
74+
return this.pinned && (this.grid.pinnedRecords.indexOf(this.treeRow) === -1);
75+
}
76+
5977
/**
6078
* Returns a value indicating whether the row component is expanded.
6179
*
@@ -113,8 +131,7 @@ export class IgxTreeGridRowComponent extends IgxRowDirective<IgxTreeGridComponen
113131
protected resolveClasses(): string {
114132
const classes = super.resolveClasses();
115133
const filteredClass = this.treeRow.isFilteredOutParent ? 'igx-grid__tr--filtered' : '';
116-
const pinnedRecordClass = this.pinned && (this.grid.pinnedRecords.indexOf(this.treeRow) === -1) ?
117-
'igx-grid__tr--disabled' : '';
134+
const pinnedRecordClass = this.pinnedBodyInstance ? 'igx-grid__tr--disabled' : '';
118135
return `${classes} ${filteredClass} ${pinnedRecordClass}`;
119136
}
120137

0 commit comments

Comments
 (0)