這是一個古老的questiotn但我有完全相同的問題,所以我給我的解決方案在這裏:
我抄在aggregateTemplate細胞模板,然後適應它顯示的箭頭,稱爲功能計算總價值(我只是複製的第一行實例的值,總結,對值最小或最大可能在列定義進行參數)
groupTemplate=
'<div ng-style="{\'top\':row.offsetTop+\'px\'}" class="{{row.aggClass()}}"></div>'
+'<div ng-click="row.toggleExpand()" ng-style="{ \'cursor\': row.cursor ,\'top\':row.offsetTop+\'px\'}" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell ngCellGroup {{col.cellClass}}">'
+'<div class="ngVerticalBar" ng-style="{height: rowHeight}" ng-class="{ ngVerticalBarVisible: !$last }"> </div>'
+'<div >{{aggFc(row,col) }}</div>'
+'</div>';
$scope.aggFc=function(rowAgg,col){
var row=rowAgg.children[0];
if(row.entity[col.field] && col.cellFilter){
console.log("'"+row.entity[col.field]+"' |" +col.cellFilter);
return $scope.$eval("'"+row.entity[col.field]+"' |" +col.cellFilter);
}
return row.entity[col.field]
};
$scope.yourGrid =
{
data: '...',
enableCellSelection: false,
enableRowSelection: true,
aggregateTemplate:groupTemplate,
...
我覺得這個解決方案可以通過調整「$使用scope.aggFc「功能的靈感來自你給的鏈接(How to set aggregation with grouping in ng-grid)