Skip to content

Commit

Permalink
fix(igxPivot): Re-trigger pipes for rows when columns change. (#14769)
Browse files Browse the repository at this point in the history
  • Loading branch information
MayaKirova authored Sep 20, 2024
1 parent b0a9482 commit 382dd79
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
});

this.updateColumns(columns);
this.pipeTrigger++;
this.reflow();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,27 @@ describe('IgxPivotGrid #pivotGrid', () => {
expect(displayedRow).toContain('RowMember');
});

it('should render correctly when going from all dimensions and values disabled to single column dimension enabled.', () => {
const pivotGrid = fixture.componentInstance.pivotGrid as IgxPivotGridComponent;
// disable all
pivotGrid.pivotConfiguration.rows.forEach(x => pivotGrid.toggleDimension(x));
pivotGrid.pivotConfiguration.columns.forEach(x => pivotGrid.toggleDimension(x));
pivotGrid.pivotConfiguration.filters.forEach(x => pivotGrid.toggleDimension(x));
pivotGrid.pivotConfiguration.values.forEach(x => pivotGrid.toggleValue(x));
fixture.detectChanges();

// no rows, just empty message
expect(pivotGrid.rowList.length).toBe(0);
expect(pivotGrid.tbody.nativeElement.textContent).toBe('Pivot grid has no dimensions and values.');

pivotGrid.toggleDimension(pivotGrid.pivotConfiguration.columns[0]);
fixture.detectChanges();

// 1 row, 3 columns
expect(pivotGrid.rowList.length).toBe(1);
expect(pivotGrid.columns.length).toBe(3);
});


describe('IgxPivotGrid Features #pivotGrid', () => {
it('should show excel style filtering via dimension chip.', async () => {
Expand Down

0 comments on commit 382dd79

Please sign in to comment.