在数据库中搜索后。在Angular网格中,无限滚动不起作用

时间:2016-12-29 06:42:34

标签: angularjs infinite-scroll angular-grid

使用过滤器进行数据库搜索后,滚动无效,否则运行正常。下面是我的get data down方法代码。

$scope.getDataDown = function() {
    var promise = $q.defer();
    $scope.lastPage++;
    if ($scope.data.length < $scope.total) {
    $http(getRequest()).success(function(data) {
        promise.resolve();
        $scope.gridApi.infiniteScroll.saveScrollPercentage();
        $scope.data = $scope.data.concat(data.content);
        $scope.total = data.total ? data.total : data.length;
        $scope.length = $scope.data.length;
        $scope.dataLength = $scope.data.length;
        $scope.gridApi.infiniteScroll.dataLoaded(false,
        $scope.lastPage < ($scope.total / $scope.pageSize));
      }).error(function(error) {
      $scope.gridApi.infiniteScroll.dataLoaded();
    });
  }
  return promise.promise;
};

0 个答案:

没有答案