-
Notifications
You must be signed in to change notification settings - Fork 160
Description
Description
When using the IgxGridState directive with IgxHierarchicalGrid it is throwing an error when trying to getState
"ERROR TypeError: Cannot read property 'columns' of null"
- igniteui-angular version:
"igniteui-angular": "^9.0.6", - browser:
Tested on Chrome (Version 80.0.3987.149), Firefox (73.0.1) & Edge (Version 80.0.361.69)
Steps to reproduce
https://stackblitz.com/edit/igx-hierarchical-grid-persistence
- Move a column around
- Click on Save
- The error is printed in the console and the state is not saved
Result
Error is printed and state is not usable
Expected result
No error then we can save/restore the state
Attachments
https://stackblitz.com/edit/igx-hierarchical-grid-persistence
The error in Stackblitz is not printed correctly, please consider reproducing in local to have the full error
Explanation of error
The error occurs in igniteui-angular-js line 59584 in function "getColumns()" (I don't have sourcemap) because this.grid is null.
I think this.grid is null because I'm using IgxHierarchicalGrid and not IgxGrid but I didn't find anything else to use in the doc/code (for example I looked for a IgxHierarchicalGridStateDirective)
I labeled this as a bug because the spec (https://github.com/IgniteUI/igniteui-angular/wiki/Grid-State-Persistence) specifies that it should work with all grids
If I'm mistaken and I just used the wrong directive, please show me the one to use and consider updating the doc

