0
votes

I have an expandable ui-grid and need an infinite scroll on the expanded (child) grids. I will only show the first few lines of data, and will rely on the user to scroll to the bottom of the expanded grid to indicate that more data should be read in (there is a potential for a large amount of data).

I understand I can create a function which will be called when more data is needed: $scope.subGridApi.infiniteScroll.on.needLoadMoreData($scope, $scope.getDataDown);

But when this function ($scope.getDataDown) is called, I don't know which expanded grid needs more data. Is there a way to determine which expanded grid is being scrolled? Once I know that, I can determine the query I need to make to the server to get the next rows of data.

1
Not sure why this was downgraded. - ScottE

1 Answers

1
votes

When setting up the infinite scroll of the child grid, you set up the function to be called to get more data:

$scope.subGridApi.infiniteScroll.on.needLoadMoreData($scope, $scope.getDataDown);

The called function (getDataDown) doesn't receive any parameters. But this.grid.api.grid is the current grid, and this.grid.api.grid.parentRow contains the row, which is where I had stored the details of what data I needed to retrieve next.