Using ngGrid v2.X, I am trying to devolop a grid that loads more data when page scrolling (not grid scrolling) is reduced.
When searching for similar questions, I found a solution to my first problem : ngGrid should have dynamic height , so I did it
.ngViewport{ height:auto !important; } .ngCanvas, .ngViewport, .ngRow, .ngFooterPanel, .ngTopPanel { width: 100% !important; } .ngRow { border-bottom:none !important; }
Which brings me to my second problem. I need the data to be loaded by scrolling, and I found: ngGridEventScroll , but o nly triggers, when ngGrid intern scroll, I need a page scroll
$scope.$on('ngGridEventScroll', function () { $scope.currentDataPosition++; $scope.setPagingData($scope.dataArray, $scope.currentDataPosition, $scope.pagingOptions.pageSize); });
So solution 1 violates solution 2 because ngGridEventScroll no longer has intern scrolling.
$scope.setPagingData = function (data, page, pageSize) { cfpLoadingBar.start(); var pagedData = data.slice((page - 1) * pageSize, page * pageSize, page * pageSize); $scope.totalServerItems = data.length; $scope.myData = pagedData; cfpLoadingBar.complete(); }; $scope.gridOptions = { data: 'myData', virtualizationThreshold: 50, enableRowSelection: false, enablePaging: false, enableSorting: false, showFooter: false, pagingOptions: $scope.pagingOptions, filterOptions: $scope.filterOptions, }
What can be done?