3

使用过滤器搜索数据库后,滚动不起作用,否则它工作正常。下面是我的获取数据方法的代码。

$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;
};
4

0 回答 0