Skip to content

Commit 9c2f5f8

Browse files
authored
Merge pull request #7172 from IgniteUI/pbozhinov/treegrid-rp-filtering
Treegrid Pinned Row & Filtering
2 parents 24c11a4 + 5134504 commit 9c2f5f8

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
14581458

14591459
});
14601460

1461-
it('should add pinned badge in the pinned row instance in the body', () => {
1461+
it('should add pinned chip in the pinned row instance in the body', () => {
14621462
const rowToPin = treeGrid.getRowByIndex(0);
14631463
const primaryKey = treeGrid.primaryKey;
14641464

@@ -1636,5 +1636,20 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
16361636
{ID: 475, Name: 'Michael Langdon'},
16371637
]);
16381638
});
1639+
1640+
it('should remove the pinned chip for filtered out parent', () => {
1641+
treeGrid.pinRow(147);
1642+
fix.detectChanges();
1643+
1644+
treeGrid.filter('ID', 957, IgxStringFilteringOperand.instance().condition('contains'), false);
1645+
fix.detectChanges();
1646+
1647+
const firstColumnField = treeGrid.columns[0].field;
1648+
const pinnedChipExpectedPosition = treeGrid.getCellByColumn(1, firstColumnField);
1649+
const pinnedRow = pinnedChipExpectedPosition.row;
1650+
1651+
expect(pinnedChipExpectedPosition.nativeElement.getElementsByClassName('igx-grid__td--pinned-chip').length).toBe(0);
1652+
expect(pinnedRow.disabled).toBe(false);
1653+
});
16391654
});
16401655
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
612612
$implicit: this.isGhostRecord(rowData) ? rowData.recordRef : rowData,
613613
index: this.getRowIndex(rowIndex, pinned),
614614
templateID: this.isSummaryRow(rowData) ? 'summaryRow' : 'dataRow',
615-
disabled: this.isGhostRecord(rowData)
615+
disabled: this.isGhostRecord(rowData) ? rowData.recordRef.isFilteredOutParent === undefined : false
616616
};
617617
}
618618

0 commit comments

Comments
 (0)