I am currently utilizing angularjs 1.5.0 along with angular ui grid 3.1.1. In my controller, I assign the gridOptions object (which is passed to the grid directive) in the following way:
$scope.gridOptions = {
data: [{"mock2": 1, "mock1": 2}, {"mock2": 10, "mock1": 22} ]
};
HTML:
<div ui-grid="gridOptions"></div>
The table displays correctly at this point. However, when attempting to update the data within $scope.on:
$scope.$on('update', function (event, passedFromBroadcast) {
$scope.gridOptions.data= [{"mock2": "set", "mock1": "inside"}, {"mock2": "$scope", "mock1": "on"} ] ;
});
Only the frame of the table is rendered. When pagination is included, it will also display pagination controls - but not the actual content itself. The rows and column headers only appear after resizing the browser window.
- Why does the angular-ui grid not update the table content when the data changes within $scope.on?
How can I manually trigger an update for the angular ui grid table? Here are the methods I have already attempted:
$scope.gridApi.core.handleWindowResize(); // Does not work $scope.gridApi.core.refresh(); // Does not work $timeout(function(){$scope.gridOptions.data= [{"mock2": "set", "mock1": "inside"}, {"mock2": "$scope", "mock1": "on"} ] ;}) // Does not work