forked from angular-ui/ui-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
Grid Events
ehfeng edited this page Mar 5, 2013
·
16 revisions
ng-grid emits events up the scope to anyone who decides to listen to them:
When Columns are re-ordered 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 whether or not the column is visible/ what direction it is sorted etc..
$scope.$emit('ngGridEventSorted', SortedColumn);