Skip to content

Commit cb5553d

Browse files
authored
Merge branch 'master' into tzhelev/esf-load-on-demand
2 parents 81f2197 + 9831e6f commit cb5553d

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

projects/igniteui-angular/src/lib/grids/column.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,8 +1687,8 @@ export class IgxColumnComponent implements AfterContentInit {
16871687
*/
16881688
public get pinnable() {
16891689
const gridUnpinnedWidth = (this.grid as any).getUnpinnedWidth(true);
1690-
const columnWidth = parseInt(this.width, 10);
1691-
return !((gridUnpinnedWidth - columnWidth) < this.grid.unpinnedAreaMinWidth);
1690+
const elementWidth = this.parent ? parseInt(this.topLevelParent.width, 10) : parseInt(this.width, 10);
1691+
return !((gridUnpinnedWidth - elementWidth) < this.grid.unpinnedAreaMinWidth);
16921692
}
16931693

16941694
/**

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3506,7 +3506,8 @@ describe('IgxGrid - Filtering actions - Excel style filtering', () => {
35063506
IgxGridFilteringComponent,
35073507
IgxTestExcelFilteringDatePickerComponent,
35083508
IgxGridFilteringESFTemplatesComponent,
3509-
IgxGridFilteringESFLoadOnDemandComponent
3509+
IgxGridFilteringESFLoadOnDemandComponent,
3510+
IgxGridFilteringMCHComponent
35103511
],
35113512
imports: [
35123513
NoopAnimationsModule,
@@ -5646,6 +5647,37 @@ describe('IgxGrid - Filtering actions - Excel style filtering', () => {
56465647
expect(listItems.length).toBe(6, 'incorrect rendered list items count');
56475648
loadingIndicator = GridFunctions.getExcelFilteringLoadingIndicator(fix);
56485649
expect(loadingIndicator).toBeNull('esf loading indicator is visible');
5650+
}));
5651+
});
5652+
5653+
describe(null, () => {
5654+
let fix, grid;
5655+
beforeEach(fakeAsync(() => {
5656+
fix = TestBed.createComponent(IgxGridFilteringMCHComponent);
5657+
grid = fix.componentInstance.grid;
5658+
grid.filterMode = FilterMode.excelStyleFilter;
5659+
fix.detectChanges();
5660+
}));
5661+
5662+
it('Should not pin column when its parent group cannot be pinned.', fakeAsync(() => {
5663+
// Test prerequisites
5664+
grid.width = '1000px';
5665+
fix.detectChanges();
5666+
tick(100);
5667+
5668+
// Pin the 'AnotherField' column.
5669+
GridFunctions.clickExcelFilterIcon(fix, 'AnotherField');
5670+
fix.detectChanges();
5671+
GridFunctions.clickPinIconInExcelStyleFiltering(fix, false);
5672+
tick(200);
5673+
fix.detectChanges();
5674+
5675+
// Verify that the 'ProductName' pin button is disabled, because its parent column cannot be pinned.
5676+
GridFunctions.clickExcelFilterIcon(fix, 'ProductName');
5677+
fix.detectChanges();
5678+
const pinButton = GridFunctions.getExcelFilteringPinContainer(fix);
5679+
expect(pinButton.classList.contains('igx-excel-filter__actions-pin--disabled')).toBe(true,
5680+
'pinButton should be disabled');
56495681
}));
56505682
});
56515683
});

0 commit comments

Comments
 (0)