2

when applying filter on group-headers in ui-grid , they disappear . i have the same problem with column-footer when we have it in result of a grouping operation (when footer aggregate function is defined without grouping it is shown correctly with applied filter ).

col.cellTemplate='<div>{{COL_FIELD | currency:"":0}} </div>';

i have to change it to bellow to get it work:

col.cellTemplate= 
'<div ng-if="!row.groupHeader">{{COL_FIELD | currency:"":0}} </div>'    
+'<div ng-if="row.groupHeader" >{{COL_FIELD }}</div>'      

but it is not what i really need ;

1 Answers1

1

Grouping by default adds a label to the header. This causes issues with the cell filters. You have two options.

  1. Remove labels from the group headers. This can be easily achieved by using a customTreeAggregationFinalizerFn. Add the below code to the columnDefs of the required columns.

customTreeAggregationFinalizerFn: function( aggregation ){ aggregation.rendered = aggregation.value; }

After adding this your cellFilter property will work on the group headers.

  1. Modify your filters to analyse and work with the group labels.
Kols
  • 3,641
  • 2
  • 34
  • 42