-
Notifications
You must be signed in to change notification settings - Fork 1.7k
#880, make the demo at /#virtual-paging work properly #1229
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
Conversation
…t index -1 failed: Fenwick tree array not initialized.' and make the demo work properly at https://swimlane.github.io/ngx-datatable/#virtual-paging
| @Input() set rows(val: any[]) { | ||
| this._rows = val; | ||
| this.rowExpansions.clear(); | ||
| this._rowCount = this._rows.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work right since the row count varies. There is a function to get this information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah, I see that /#server-paging is indeed broken with my change. Wonder if it's worth it to maybe add more e2e tests that could potentially catch such errors.
|
Ok, back to the drawing board then. It fixes the error and all the tests passed, so I assumed it was enough. So, just to make it clear, there could be cases where rowCount is not equal to the number of rows? |
|
Server side paging. |
|
Alright, I have pushed my second attempt at it, both /#server-paging and /#virtual-paging seem to be working now... |
amcdnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
set rowCount to rows.length, to prevent 'Error: query at index -1 failed: Fenwick tree array not initialized.' and make the demo work properly at https://swimlane.github.io/ngx-datatable/#virtual-paging
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
As described in the issue #880 and currently on https://swimlane.github.io/ngx-datatable/#virtual-paging or http://localhost:9999/#virtual-paging, virtual paging demo throws an error because the rowCount does not properly reflect the number of rows
What is the new behavior?
Fixes the said javascript error and make the demo work as intended
Does this PR introduce a breaking change? (check one with "x")