{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3309","labels_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3309/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3309/comments","events_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3309/events","html_url":"https://github.com/angular-ui/ng-grid/issues/3309","id":69226687,"number":3309,"title":"grouping/aggregation filter applying to entire aggregation string","user":{"login":"meyerds","id":331378,"avatar_url":"https://avatars.githubusercontent.com/u/331378?v=3","gravatar_id":"","url":"https://api.github.com/users/meyerds","html_url":"https://github.com/meyerds","followers_url":"https://api.github.com/users/meyerds/followers","following_url":"https://api.github.com/users/meyerds/following{/other_user}","gists_url":"https://api.github.com/users/meyerds/gists{/gist_id}","starred_url":"https://api.github.com/users/meyerds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meyerds/subscriptions","organizations_url":"https://api.github.com/users/meyerds/orgs","repos_url":"https://api.github.com/users/meyerds/repos","events_url":"https://api.github.com/users/meyerds/events{/privacy}","received_events_url":"https://api.github.com/users/meyerds/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/ng-grid/labels/waiting-response","name":"waiting-response","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular-ui/ng-grid/milestones/15","html_url":"https://github.com/angular-ui/ng-grid/milestones/Future","labels_url":"https://api.github.com/repos/angular-ui/ng-grid/milestones/15/labels","id":800227,"number":15,"title":"Future","description":"Any features not slated for a specific release","creator":{"login":"swalters","id":195646,"avatar_url":"https://avatars.githubusercontent.com/u/195646?v=3","gravatar_id":"","url":"https://api.github.com/users/swalters","html_url":"https://github.com/swalters","followers_url":"https://api.github.com/users/swalters/followers","following_url":"https://api.github.com/users/swalters/following{/other_user}","gists_url":"https://api.github.com/users/swalters/gists{/gist_id}","starred_url":"https://api.github.com/users/swalters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swalters/subscriptions","organizations_url":"https://api.github.com/users/swalters/orgs","repos_url":"https://api.github.com/users/swalters/repos","events_url":"https://api.github.com/users/swalters/events{/privacy}","received_events_url":"https://api.github.com/users/swalters/received_events","type":"User","site_admin":false},"open_issues":148,"closed_issues":86,"state":"open","created_at":"2014-09-23T19:11:23Z","updated_at":"2015-04-20T20:52:47Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-04-17T22:08:04Z","updated_at":"2015-04-20T21:07:01Z","closed_at":null,"body":"This issue seen in the latest unstable build.\r\n\r\nThe aggregated values in a grouping header row have any cell filters applied *after* the aggregation string is built (e.g. filter runs against \"avg: *data*\" instead of against *data*), which causes many filters to fail.\r\n\r\nSee this issue in http://plnkr.co/edit/VBIbnVYcY4ra825647Vy"},"comment":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/comments/94568228","html_url":"https://github.com/angular-ui/ng-grid/issues/3309#issuecomment-94568228","issue_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3309","id":94568228,"user":{"login":"PaulL1","id":5248789,"avatar_url":"https://avatars.githubusercontent.com/u/5248789?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulL1","html_url":"https://github.com/PaulL1","followers_url":"https://api.github.com/users/PaulL1/followers","following_url":"https://api.github.com/users/PaulL1/following{/other_user}","gists_url":"https://api.github.com/users/PaulL1/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulL1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulL1/subscriptions","organizations_url":"https://api.github.com/users/PaulL1/orgs","repos_url":"https://api.github.com/users/PaulL1/repos","events_url":"https://api.github.com/users/PaulL1/events{/privacy}","received_events_url":"https://api.github.com/users/PaulL1/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T21:07:01Z","updated_at":"2015-04-20T21:07:01Z","body":"Yeah, although I have no idea how to actually change it, since the filters get applied via an angular binding.  I could maybe write a filter that applies the totals/aggregations, and add that filter to the end of the filters, but it's getting a little too tricky I think.\r\n\r\nIn my code, I just unstring it in the filter.  Most commonly I'm doing this on a reference data lookup (changing 1 => active, 2=> inactive or similar).  I have a generic routine that makes filters for my ref data:\r\n\r\n```\r\n.factory('SystemRefDataService', function( ){\r\n  var systemRefDataService = {\r\n    genericMap: function( constant, constantName ) {\r\n      return function (input) {\r\n        var result;\r\n        var match;\r\n        \r\n        if(!input) {\r\n          return '';\r\n        } else if (result = constant[input]) {\r\n          return result;\r\n        } else if ( ( match = input.match(/(\\d+)( \\(\\d+\\))/) ) && ( result = constant[match[1]] ) ) {\r\n          return result + match[2];\r\n        } else {\r\n          if(!$rootScope[constantName + 'Error']) {\r\n            LoggingService.logError('42001: ' + constantName + ' not recognised', 'SYSTEM_REF_DATA', {input: input});\r\n            $rootScope[constantName + 'Error'] = true;\r\n          }\r\n          return 'MSG_base_42001_system_ref_data_not_recognised';\r\n        }\r\n      };\r\n    }\r\n  };\r\n  \r\n  return systemRefDataService; \r\n})\r\n```\r\n\r\nI hold most of my refData in constants in the format: \r\n```\r\n.factory( 'ProjectStatusesConstant', function() {\r\n  return {\r\n      1: 'VALUE_project_project_status_active',\r\n      2: 'VALUE_project_project_status_inactive'\r\n  };\r\n})\r\n```\r\n\r\nSo I can define a filter by:\r\n```\r\n.filter('mapProjectStatus', function( ProjectStatusesConstant, SystemRefDataService ) {\r\n  return SystemRefDataService.genericMap( ProjectStatusesConstant, 'project_statuses');\r\n})\r\n```"}}