Skip to content

Commit 193c0c7

Browse files
committed
feat(igxTreeGrid): Exposes disabled sass property #6640
1 parent cd9b808 commit 193c0c7

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-component.scss

+4
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@
126126
@extend %igx-grid__tr--drag !optional;
127127
}
128128

129+
@include e(tr, $m: 'disabled') {
130+
@extend %igx-grid__tr--disabled !optional;
131+
}
132+
129133
@include e(tr, $m: 'ghost') {
130134
@extend %igx-grid__tr--ghost !optional;
131135
}

projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss

+4
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,10 @@
10371037
opacity: .5;
10381038
}
10391039

1040+
%igx-grid__tr--disabled {
1041+
opacity: .5;
1042+
}
1043+
10401044
%grid-row--odd {
10411045
background: --var($theme, 'row-odd-background');
10421046
color: --var($theme, 'row-odd-text-color');

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

+14-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ export class IgxTreeGridRowComponent extends IgxRowDirective<IgxTreeGridComponen
4444
}
4545
}
4646

47+
/**
48+
* Gets whether the row is pinned.
49+
*
50+
* @example
51+
* ```typescript
52+
* let pinned = row.pinned;
53+
* ```
54+
*/
55+
public get pinned(): boolean {
56+
return this.grid.isRowInPinnedRecordsStructure(this._treeRow);
57+
}
58+
4759
/**
4860
* Returns a value indicating whether the row component is expanded.
4961
*
@@ -101,7 +113,8 @@ export class IgxTreeGridRowComponent extends IgxRowDirective<IgxTreeGridComponen
101113
protected resolveClasses(): string {
102114
const classes = super.resolveClasses();
103115
const filteredClass = this.treeRow.isFilteredOutParent ? 'igx-grid__tr--filtered' : '';
104-
return `${classes} ${filteredClass}`;
116+
const pinnedRecordClass = this.pinned ? 'igx-grid__tr--disabled' : '';
117+
return `${classes} ${filteredClass} ${pinnedRecordClass}`;
105118
}
106119

107120
/**

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
566566
/**
567567
* @hidden @internal
568568
*/
569-
private isRowInPinnedRecordsStructure(rec: ITreeGridRecord): boolean {
569+
public isRowInPinnedRecordsStructure(rec: ITreeGridRecord): boolean {
570570
let inStructure = false;
571571
this.pinnedRecords.forEach(pinnedRecord => {
572572
if (JSON.stringify(pinnedRecord.data) === JSON.stringify(rec.data)) {

0 commit comments

Comments
 (0)