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

P-table: Cannot read property 'nativeElement' of undefined #8227

Closed
filip12345678910 opened this issue Oct 10, 2019 · 1 comment
Closed

P-table: Cannot read property 'nativeElement' of undefined #8227

filip12345678910 opened this issue Oct 10, 2019 · 1 comment

Comments

@filip12345678910
Copy link

Hi, we "solved" the issue of unnecessary triggering of lazy load event (#7657)
by turning off virtual scroll when there is a small number of rows. We react to change of totalRecords, but p-table also reacts to change of totalRecords, by trying to setVirtualScrollerHeight, but this ends up throwing
P-table Cannot read property 'nativeElement' of undefined
because in the meantime, we set virtualScroll false and I think that it causes your virtualScrollerViewChild to be undefined.
Can you please repair

ScrollableView.prototype.setVirtualScrollerHeight = function () {
if (this.virtualScrollerViewChild.nativeElement) {
this.virtualScrollerViewChild.nativeElement.style.height = this.dt.totalRecords * this.dt.virtualRowHeight + 'px';
}
};
so that it doesn't throw error when this.virtualScrollerViewChild is undefined? Or repair the original issue #7657

@cagataycivici
Copy link
Member

76657 is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants