Skip to content
timothyswt edited this page Feb 11, 2013 · 4 revisions

ng-grid emits events up the scope to anyone who decides to listen to them:

When Columns are re-rderd you get an [] of all the columns in their current state.

$scope.$emit('ngGridEventColumns', newColumns);

When the grid data source is changed this event is fired letting you know that data was successfully modified.

$scope.$emit('ngGridEventData', gridId);

When the filter is changed this event is fired.

$scope.$emit('ngGridEventFilter', newFilterText);

When anyone groups the data

$scope.$emit('ngGridEventGroups', newGroups);

When new rows are rendered in the grid: (scrolling fires this a lot)

$scope.$emit('ngGridEventRows', newRows);

When the user has scrolled to the bottom of the grid this event fires. useful for infinite/server-side scrolling.

$scope.$emit('ngGridEventScroll');

When sorting happens (see src/classes/column.js) this way you can detect wether or not the column is visible/ what direction it is sorted etc..

$scope.$emit('ngGridEventSorted', SortedColumn);
Clone this wiki locally