【发布时间】:2017-05-06 12:11:30
【问题描述】:
在第一次加载的网格中,我正在正确获取数据。 向下滚动后出现问题。 它显示每行中第一次加载的最后一条记录的最后一条记录。
下面是我的无限滚动功能代码。
$scope.getDataDown = function() {
var promise = $q.defer();
$scope.lastPage++;
if ($scope.data.length < $scope.total) {
$http(getRequest()).success(function(data) {
promise.resolve();
var jb = JSON.stringify(data.content);
$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.gridApi.infiniteScroll.dataLoaded(false,
$scope.lastPage < ($scope.total / $scope.pageSize));
}).error(function(error) {
$scope.gridApi.infiniteScroll.dataLoaded();
});
}
return promise.promise;
};
【问题讨论】:
-
还有一件事我在“data.content”中获得了正确的数据,但是在显示它时出现了问题
标签: angularjs angular-ui-grid infinite-scroll ui-grid