{"action":"opened","issue":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4142","labels_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4142/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4142/comments","events_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4142/events","html_url":"https://github.com/angular-ui/ui-grid/issues/4142","id":99710618,"number":4142,"title":"Grouping aggregation functions break when grouping by column applied too.","user":{"login":"kelpycreek","id":9507688,"avatar_url":"https://avatars.githubusercontent.com/u/9507688?v=3","gravatar_id":"","url":"https://api.github.com/users/kelpycreek","html_url":"https://github.com/kelpycreek","followers_url":"https://api.github.com/users/kelpycreek/followers","following_url":"https://api.github.com/users/kelpycreek/following{/other_user}","gists_url":"https://api.github.com/users/kelpycreek/gists{/gist_id}","starred_url":"https://api.github.com/users/kelpycreek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelpycreek/subscriptions","organizations_url":"https://api.github.com/users/kelpycreek/orgs","repos_url":"https://api.github.com/users/kelpycreek/repos","events_url":"https://api.github.com/users/kelpycreek/events{/privacy}","received_events_url":"https://api.github.com/users/kelpycreek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-07T19:15:28Z","updated_at":"2015-08-07T19:15:28Z","closed_at":null,"body":"Hello,\r\nIve noticed that aggregation functions break when grouping by the column they are applied to.\r\nSteps to reproduce:\r\n1. Visit tutorial 320 here: http://ui-grid.info/docs/#/tutorial/320_complex_grouping\r\n2. Select 'group' in the column menu for any (or all) of the 'balance' columns\r\n\r\nexpected result: The column continues to display its aggregated  result whether or not it is grouped.\r\nactual result: the aggregated column changes to be blank.\r\n\r\n3. ungroup the column\r\n\r\nexpected result: Grouping a column and then ungrouping it should return the grid to the exact state it was in before grouping.\r\nactual result: The column remains blank, having grouped it appears to have permanently destroyed its ability to aggregate values inside of it. The only way to restore functionality is to refresh the page.\r\n\r\nWhat I believe is happening:\r\nI discovered this after writing some custom aggregation functions for each column of my app, and it appears that using the column menu to group an item causes the grouping feature to not use my custom aggregation function, but still use the custom finalizer function. Since the finalizer function is built using knowledge of the aggregation function, it breaks."}}