Closed rosepriya-jk closed 7 years ago
Hi!
Could you post an example app (jsbin preferably) where this happens? Thanks!
Hi, Sharing a jsbin example of the issue
Thanks! I'll try to fix this asap
@Saulis We kinda got a fix https://github.com/sravan-s/iron-data-table/commit/cbb125d076e315ee90e67fec1e956b4fcd1977d9
:question: @Saulis I have a question, would there be any benefits if we place the code calculating 'this._currentPage' inside a debounce function? That function is getting triggered a lot. This is it: https://github.com/sravan-s/iron-data-table/commit/3dd3116cde2d15cfa311392a350fd19a2a00ce4f
The actual problem here was that the size
is set after the first page has been loaded and the table doesn't react to data source size changes automatically, therefore loading the second page which contains items 50-54.
I've made a PR that tries to update the last page after size is increased. Meanwhile, you can as a workaround just set the size
before any data is loaded.
@sravan-s not sure if debouncing that would help anything, _currentPage
doesn't change on every scroll event which triggers all the actual data loading. Only thing that might need optimizing is that scrollTop
is read multiple times, but I think browsers cache that.
If the branch refresh-on-increase
works for you, I'll merge and publish it.
For server-side pagination, the
datasource
is not triggered, when the size is more than the defaultpageSize
which is 50, but not more than 57, since thecurrentPage
value is not updated. ThecurrentPage
value gets rounded-off to 0 in this case.