css - How to show column footer in grouped grid in AngularJS ui-grid? -


i'm using angularjs ui-grid , followed tutorial show column footer of gird, worked fine. however, after added grouping function in grid, column footer disappeared.

from 105_footer tutorial, used aggregate column values:

aggregationtype: uigridconstants.aggregationtypes.sum 

in grouping's column definition, added aggregate column values:

treeaggregation: {type: uigridgroupingconstants.aggregation.sum} 

the problem column aggregation isn't aware of grouping, trying blindly aggregate visible rows in column. result in wrong answer.

there 2 forms of wrong here:

  1. grouping default puts labels text - "max: 30" example in age column. aggregation cannot aggregate. can fix customfinalizerfn, i've done in plunker below

  2. aggregation aggregates visible rows, including groupheader rows. if had 1 level of grouping , expanded all, sum aggregation end double real value. if had 2 levels of grouping triple.

in short, think it's bad idea use column footers , column level aggregation grouping.

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; } }, 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -