0

ag-grid のグループ化を使用して、複数のレベルの貸借対照表を表示しようとしています。それは機能しますが、データにnullは階層がレベルをスキップする場所があり、これらの行を非表示にしたい-例:

Level0 - Level1 - Level2 - AccountName - Value
Assets  - null   - null   - Cash - $10,000
Liabilities - Payables - Short Term - Invoices - $5,000

したがって、私のグリッドでは、Liabilities階層は問題ないように見えますが、Assets階層にはとnullの間に 2 つのレベルがAssetsありCashます。行を非表示にしたいnull。添付の写真を参照してください:

NULL を含む貸借対照表

ここでNiallが言及した構成を使用して、これを機能させようとしています:

<div ng-grid="gridOptions" ng-show="gridOptions.rowData.length>0"/>

また:

<div ng-grid="gridOptions" ng-if="gridOptions.rowData.length>0"/>

しかし、私のrowDataはではなくnullgroupColumnDefです。

/に必要gridOptions.rowNode.dataですか? これを解決する方法がわかりません。ng-ifng-show

コントローラーのコードは次のとおりです。

(function () {
'use strict';

angular
    .module('app')
    .controller('BalShtController', BalShtController);

BalShtController.$inject = ['$scope', '$http'];

function BalShtController($scope, $http) {
    $scope.title = 'Balance Sheet';

    var columnDefs = [
      { headerName: "No.", field: "GlNumber", sort: 'asc', hide: 'true' },
      { headerName: "Value", field: "Value", cellRenderer: currencyFormat, cellStyle: currencyCssFunc, width: 200 }

    ];



    $scope.gridOptions = {
        columnDefs: columnDefs,
        rowData: null,
        enableFilter: true,
        enableColResize: true,
        onReady: function () {
            $scope.gridOptions.api.sizeColumnsToFit()
        },

        groupKeys: ['GlPartnerLevel1', 'GlPartnerLevel2', 'GlPartnerLevel3', 'GlPartnerLevel4', 'GlName'],
        groupAggFields: ['Value'],
        groupDefaultExpanded: 3,

        groupIncludeFooter: true,
        groupColumnDef: {
            headerName: "Detail",
            field: "TxTransactionDate",
            width: 300,
            cellRenderer: {
                renderer: 'group',
                footerValueGetter: '"Total (" + x + ")"',
                padding: 5
            }
        },

    };
$http.get("http://localhost:39016/api/BalanceSheet")
            .then(function (res) {
                $scope.gridOptions.api.setRowData(res.data);

            });
    }
})();
4

0 に答える 0