我使用AngularJS ui-grid跟着这个tutorial以显示网格的列脚注,它工作得很好。然而,我加入了网格分组功能之后,列页脚消失。
从105_footer教程中,我用这个来聚合列值:
aggregationType: uiGridConstants.aggregationTypes.SUM
在分组的列定义,我已将此添加到聚合列值:
treeAggregation: {type: uiGridGroupingConstants.aggregation.SUM}
问题是,列聚集不知道分组的,因此它试图一味聚集在列中的所有可见行。这可能会导致错误的答案。
有两种形式的错在这里:
总之,我认为这可能是一个坏主意,用柱页脚和列级聚集与分组。
http://plnkr.co/edit/1znbxELDzeNVK3x3G1c2?p=preview
showGridFooter: true,
showColumnFooter: true,
{ name: 'age', treeAggregationType: uiGridGroupingConstants.aggregation.MAX, aggregationType: uiGridConstants.aggregationTypes.avg, width: '20%', customTreeAggregationFinalizerFn: function( aggregation ){ aggregation.rendered = aggregation.value; } },