0

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. Commented Feb 10, 2016 at 19:17

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.