expandAllRows does not work from ngOnInit or ngAfterViewInit
See original GitHub issueI’m submitting a … (check one with “x”)
[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior Calling table.rowDetail.expandAllRows() or collapseAllRows() only works after the view is fully initialized (i.e calling from a button click).
When called from ngOnInit or ngAfterViewInit, calling exapndAllRows() does not do anything, the rows remain in collapsed state.
Expected behavior Calling exapndAllRows from in ngOnInit and certainly in ngAfterViewInit, should start the rows in an expanded state.
Reproduction of the problem Modify the demo project you have showing collapse/expand to call expand from ngInit to see behavior What is the motivation / use case for changing the behavior? In many cases, the preferred state is to have all rows expanded by default.
Please tell us about your environment: Windows 10, Angular 4.1, Typscript 2.4.2
-
Table version: 0.8.x Yes, using 10.1.0 still see issue
-
Angular version: 2.0.x Yes, using angular 4.3 still an issue.
-
Browser: [all ]
-
Language: [all | TypeScript X.X | ES6/7 | ES5] Typescript 2.4.2
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7 (1 by maintainers)
Top GitHub Comments
Are there any updates/solutions for this bug? I have used setTimeout function as a workaround, but this is really dirty:
I also want the rows to start expanded by default. I had to workaround this issue using the code below. However, it runs the check about five times (which makes it tough to ever collapse the rows) and I’d appreciate this bug being fixed. (Note this is the Angular Universal version)