Search code examples
angularjsngtable

ngTable multi-level or nested grouping


I am using groupBy in ngTable, but now I need a further level of grouping in the table:

$scope.tableParams = new ngTableParams({
    count: 100,
    sorting: {
        PremiumElementGroup: 'desc',
        PremiumElement: 'desc',
        LegalEntity: 'asc',
        SettlementCurrency: 'asc'
    }
}, {
    counts: [],
    groupBy: 'PremiumElementGroup' <--- only allows one level of grouping...
    , getData: function ($defer, params) {
        var orderedData = $filter('orderBy')($scope.section.PremiumCessionOverrides, params.orderBy());
        $defer.resolve(orderedData);
    }
});

Is there something I can do to achieve what I want? Or another grid tool I could use?


Solution

  • So far, there doesn't seem to be the possibility for group nesting up to multiple levels using ngTable.

    However, you can use UI Grid which, according to their documentation allows nesting up to multiple levels.

    At one example, their documentation says:

    SubGrid nesting can be done upto multiple levels..

    Side-note: You are asking for multi-level grouping or nested grouping where the title of the question is a bit misleading.