I'm trying to get a callback from the Angular UI grid (after data is loaded/rendered) but it doesn't seem to work for me.
I'm following this which says I should listen the scope using $scope.$on() and I tried this which implies I can provide a dataUpdated() and init() delegate through the options.
In both cases I don't see anything in my console... The grid renders fine and I can also see a console entry stating: 'grid refresh'.
I'm loading the grid with the following options:
$scope.$on('ngGridEventRows', function (event) {
console.log('rendering');
});
$scope.$on('ngGridEventRows', function (event) {
console.log('rendering');
});
$scope.options = {
enableSorting: true,
//data: myData,
dataUpdated: function() {
console.log('dataUpdated');
},
init: function () {
console.log('init');
}
};
$scope.grids = [$scope.options];
The options are passed to the grid as follows:
<div class="container-fluid" ng-repeat="grid in grids">
<div ui-grid="grid" ui-grid-exporter></div>
</div>
$scope.optionsobject to your grid?