Skip to content

Commit c298ebc

Browse files
committed
Merge branch 'pbozhinov/row-pinning-tree-grid' of https://github.com/IgniteUI/igniteui-angular into pbozhinov/row-pinning-tree-grid
2 parents a45ed20 + af728e2 commit c298ebc

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@
512512
@extend %igx-grid__filtering-cell !optional;
513513
}
514514

515+
@include e(filtering-cell, $m: 'selected') {
516+
@extend %igx-grid__filtering-cell !optional;
517+
@extend %igx-grid__filtering-cell--selected !optional;
518+
}
519+
515520
@include e(filtering-cell-indicator) {
516521
@extend %igx-grid__filtering-cell-indicator !optional;
517522
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@
10781078
border-bottom: none;
10791079
}
10801080

1081-
%igx-grid__tr--pinned {
1081+
%igx-grid__tr--pinned {
10821082
position: relative;
10831083
background: inherit;
10841084
z-index: 10000;
@@ -2211,6 +2211,11 @@
22112211
}
22122212
}
22132213

2214+
%igx-grid__filtering-cell--selected {
2215+
color: --var($theme, 'row-selected-text-color');
2216+
background: --var($theme, 'row-selected-cell-background');
2217+
}
2218+
22142219
%igx-grid__filtering-cell-indicator {
22152220
position: relative;
22162221
display: flex;

projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-cell.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,15 @@ export class IgxGridFilteringCellComponent implements AfterViewInit, OnInit, DoC
5959
@ViewChild('complexChip', { read: IgxChipComponent })
6060
protected complexChip: IgxChipComponent;
6161

62-
@HostBinding('class.igx-grid__filtering-cell')
63-
public cssClass = 'igx-grid__filtering-cell';
62+
63+
@HostBinding('class')
64+
get styleClasses(): string {
65+
if (this.column && this.column.selected) {
66+
return 'igx-grid__filtering-cell--selected';
67+
}
68+
69+
return 'igx-grid__filtering-cell';
70+
}
6471

6572
constructor(public cdr: ChangeDetectorRef, public filteringService: IgxFilteringService) {
6673
this.filteringService.subscribeToEvents();

projects/igniteui-angular/src/lib/grids/grid/column-selection.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { ɵɵsetComponentScope } from '@angular/core';
1212

1313
const SELECTED_COLUMN_CLASS = 'igx-grid__th--selected';
1414
const SELECTED_COLUMN_CELL_CLASS = 'igx-grid__td--column-selected';
15+
const SELECTED_FILTER_CELL_CLASS = 'igx-grid__filtering-cell--selected';
16+
1517
function selectedData() {
1618
return [{ ProductID: 1, ProductName: 'Chai' },
1719
{ ProductID: 2, ProductName: 'Aniseed Syrup' },
@@ -766,11 +768,15 @@ describe('IgxGrid - Column Selection #grid', () => {
766768

767769
it('Filtering: Verify column selection when filter row is opened ', fakeAsync(() => {
768770
grid.allowFiltering = true;
771+
fix.detectChanges();
772+
const filterCell = GridFunctions.getFilterCell(fix , 'ProductID');
773+
expect(filterCell.nativeElement.classList.contains(SELECTED_FILTER_CELL_CLASS)).toBeFalsy();
769774
const colInStock = grid.getColumnByName('InStock');
770775
colProductID.selected = true;
771776
fix.detectChanges();
772777

773-
GridFunctions.clickFilterCellChipUI(fix, 'ProductName'); // Name column contains nested object as a value
778+
expect(filterCell.nativeElement.classList.contains(SELECTED_FILTER_CELL_CLASS)).toBeTruthy();
779+
GridFunctions.clickFilterCellChipUI(fix, 'InStock'); // Name column contains nested object as a value
774780
tick(150);
775781
fix.detectChanges();
776782

0 commit comments

Comments
 (0)