These are chat archives for angular-ui/ui-grid/paging

Aug 2014
Shane Walters
Aug 06 2014 21:16
Row selection currently flags each GridRow as selected. For paging, I might need to change it to keep an array of selected rows instead. Even if I did that, there would be possible errors because the selected row would not be in the rows collection.
Aug 06 2014 23:52
@cbsm1th: FWIW, I would see paging and infinite scroll as different user representations of the same API
from an api viewpoint, ng-grid would be showing a subset of the data - for argument's sake there are 10,000 rows, and ng-grid currently has 100 of them.
when you scroll down (whether that's infinite scroll down, or press the next page button), ng-grid needs to hit some sort of callback or API to "get next 100"
The things I can imagine that would need to be covered are:
  • the basic api - declare paging active, set page size, get next page (or get page) callback
  • more advanced: hooks for filtering and searching - so whenever an ng-grid filter or search call is made, you now have to call server instead of issuing locally
  • UI effects - configure whether you want traditional paging or infinite scrolling
  • if infinite scrolling, some sort of magic that predicts when someone will hit the end of the current data set, and proactively gets the next chunk
I think there's a bit of thinking in whether we're doing paging just because we don't want to get_ all the data at once, or whether we're doing it because we don't want to _hold all the data at once
Aug 06 2014 23:57
The former implies that we get it as people scroll, but we don't have to discard what we already have - and eventually we could end up with everything held client side if they scroll for long enough. This is potentially easier to implement, and deals with some issues like "what if they selected some stuff on earlier pages"
The latter implies that we throw away what we had as they scroll, and go back to the server to get it again later if we need it - if you have a really big data set it makes sense, but otherwise it may be a lot harder for not a lot of benefit
(Note, I'm probably not a user of pagination, I just happened to read and think about it a bit, so thought I'd share my 5c despite having no dog in this fight)