-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
first if you go to the example:
http://ui-grid.info/docs/#/tutorial/212_infinite_scroll
and you do 1 click down, (so scroll only 1 row)
then 1 up again you see suddenly a completely different list. This is quite weird and brings to my question how shoiuld needLoadMoreDataTop really work?
Because if you start from the top then all the data is already there on the top.. Its not that suddenly you need to fill a row thats on a negative index
Or is this feature for that if you would start somewhere in the middle? in the first place? But then the start is just wrong, because you first have to scroll a bit down to be able to fill it up. thats just bad ui.
besides that you need to really supply neadLoadMoreDataTop because if you don't do that:
http://plnkr.co/edit/56DNHGw1FHQFF5HtpGhL?p=preview
then if you click once down, then one time up (so that it would have triggered dataTop once) then suddenly the whole needLoadMore is broken because the timeout stays on true...
so i need to always add a dummy function that just does:
gridApi.infiniteScroll.on.needLoadMoreDataTop($scope,function(){
$scope.gridApi.infiniteScroll.dataLoaded();
});
because that will set the: grid.options.loadTimout = false;
so it works the next time i scroll. But again i have no idea what to really do in that method otherwise.
If infinite scroll would really be some kind of "page" so that the needMoreData (top) did get more arguments so i know exactly what the view port should be (or become)
then i could delete rows at the top and cleanup my stuff
Then needMoreDatatop would load that data back in.
Problem is that then the scrollbar will not work i guess because for a ui-grid point of view if i would delete data on the top the total rows would just be smaller.