【问题标题】:Angular UI-grid how many rows are visible?Angular UI-grid 有多少行可见?
【发布时间】:2017-02-17 00:31:56
【问题描述】:

在 Angular UI-Grid 中,有什么方法可以告诉我的网格中有多少行可见?例如,如果我有 5,000 行,然后我过滤,并留下 2,500 行,有没有办法通过 gridApi 进行检查?

【问题讨论】:

  • 显示你做了什么?
  • 有办法,ui-grid-pagination

标签: angularjs angular-ui-grid


【解决方案1】:

你有你尝试过的例子吗?如果您还没有合并页脚元素,请从那里开始。

http://ui-grid.info/docs/#/tutorial/105_footer

$scope.gridOptions = {
    showGridFooter: true,
    showColumnFooter: true,
    enableFiltering: true,
    columnDefs: [
        { field: 'name', width: '13%' },
        { name: 'registered', field: 'registered', width: '20%', cellFilter: 'date', footerCellFilter: 'date', aggregationType: uiGridConstants.aggregationTypes.max }
    ],
    data: data,
    onRegisterApi: function(gridApi) {
        $scope.gridApi = gridApi;
    }
};

$scope.toggleFooter = function() {
    $scope.gridOptions.showGridFooter = !$scope.gridOptions.showGridFooter;
    $scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.OPTIONS);
};

您甚至可以为每列创建页脚以汇总任何存在的数据。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    相关资源
    最近更新 更多