I am using angularjs 1.5.0 with the angular ui 3.1.1 grid. When I assign the gridOptions object (passed to the grid directive) to the controller body as follows:
$scope.gridOptions = { data: [{"mock2": 1, "mock1": 2}, {"mock2": 10, "mock1": 22} ] };
HTML:
<div ui-grid="gridOptions"></div>
Displays the table as expected. But when I try to change the data inside $ scope.on:
$scope.$on('update', function (event, passedFromBroadcast) { $scope.gridOptions.data= [{"mock2": "set", "mock1": "inside"}, {"mock2": "$scope", "mock1": "on"} ] ; });
It only displays the table frame, when pagination is enabled, it will also display paginated controls, but not the content itself. Content (rows and column headers) only appears after resizing my browser window.
- Why doesn't angular -ui grid update table contents when data changes inside $ scope.on?
How to manually update the angular ui set table? Things I've already tried:
$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
source share