Igniteui-angular: Programmatically expanding row in tree grid throws error

Created on 26 Nov 2020  路  2Comments  路  Source: IgniteUI/igniteui-angular

Description

When trying to expand row in tree grid programmatically with expandRow it throws error "Cannot read property 'expansionStates' of undefined".

  • igniteui-angular version: 10.1.10
  • browser: Chrome 86.0.4240.198

Steps to reproduce

  1. In code call:
    this.treeGrid.expandRow(rowPkId);

Result

Tree grid is shown, but row is not expanded and error is thrown: "Cannot read property 'expansionStates' of undefined".

Expected result

Expected row to be expanded.

Attachments

image

bug tree-grid medium not-a-bug 10.1.x

All 2 comments

@SteffNite, I was able to reproduce this issue only if I call the expandRow method in the ngOnInit. This is expected since the grid is still not initialized in ngOnInit of its parent.
If this is your case I would suggest you to call expandRow in the ngAfterViewInit instead.

@DiyanDimitrov, Yes you are right. It was my mistake. Thank you very much for your time!

Was this page helpful?
0 / 5 - 0 ratings