If you provide total
it must represent the number of records available for the grid, not the number of records your current request returns.
E.g. your database contains 12,000 records and you are pulling them with limit 1,000, then total
should always be 12,000
so the grid know that there are still records to pull from the server (during scrolling), until all 12,000 are present in the grid.
If you do not set total, or if you explicitely set total to -1
, then you are basically telling the grid that you don't know how many records are there to pull from the server and the grid will not perform any load requests during scrolling (unless you manually set grid.last.xhr_hasMore
, which is quite low-level).
If your grid has an url and you're "manually" adding records to the grid, you must update grid.total accordingly.
Only if your grid has no url set, then grid.add() will automaticall set this.total = this.records.length
.
Unfortunately, this bug has been around for some time already, but so far noone provided a fix.
See: Fast scrolling using infinite Scroll returns blank div without records
Even in w2ui 2.0 you can reproduce it in the infinite scroll demo: http://localhost:8080/demos#/combo/5
Owner Name | vitmalina |
Repo Name | w2ui |
Full Name | vitmalina/w2ui |
Language | JavaScript |
Created Date | 2011-04-12 |
Updated Date | 2022-06-22 |
Star Count | 2000 |
Watcher Count | 179 |
Fork Count | 665 |
Issue Count | 255 |
Issue Title | Created Date | Updated Date |
---|