How to use IgxColumnPinning?
Question
I have an issue with IgxColumnPinning. Can someone advise me on how to use it correctly?
Without importing IgxColumnPinningModule, the feature works but ExpressionChangedAfterItHasBeenCheckedError is thrown at run time. Should I import IgxColumnPinningModule as same as IgxColumnHidingModule? If so, the import path turns to be import { IgxColumnPinningModule } from 'igniteui-angular/lib/grids/pinning/pinning.module';, not import { IgxGridModule, IgxColumnPinningModule } from 'igniteui-angular';
- igniteui-angular version: 10.1.4
- browser: n/a
As you can see in the screenshot, it works but the error is thorwn.
igx-grid-column-pinning-column-hiding (2).zip
The problem is not with the module but the fact the grid columns get created during content init which triggers change detection in the column actions component (so that they can get listed there). Angular doesn't like that even though apart from the exception everything would function correctly. We'll need a different solution to pass the grid context for such cases most likely.
But you should be able to use the built-in UI from the toolbar without issues - add [showToolbar]="true" [columnPinning]="true" in the grid configuration. Does the customer need the pinning UI separately?
@ChronosSF Thank you for commenting on my question. This is not an inquiry from a customer. I encountered this issue while verifying 10.1 new features of the product.
We'll resolve the exception with the fix for #8125