Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(igxPivot): Re-trigger pipes for rows when columns change. #14771

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
});

this.updateColumns(columns);
this.pipeTrigger++;
this.reflow();
if (data && data.length > 0) {
this.shouldGenerate = false;
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
Loading