Merge pull request #2262 from jpuri/master

partial fix for issue #2261
refactor(Aggregation): Use local function

The function was always iterating all rows and saving the results on a local variable to be used in only 4/6 of the time, causing a lot of overhead.

Its now wrapped in a local function and is called only when needed.
docs(GridApi) Improve docs and add example on how to subscribe to events