Is there any good way to refresh data changes manually?
I just wanna do something like this.
https://github.com/angular-ui/ng-grid/blob/2.0.8/build/ng-grid.js line:2930-
grid.applyDataChanges = function() {
dataWatcher($scope.$eval(options.data));
$scope.adjustScrollTop(grid.$viewport.scrollTop(), true);
};
// not needed ?
//$scope.$on('$destroy', $scope.$parent.$watch(options.data, dataWatcher));
$scope.$on('$destroy', $scope.$parent.$watch(options.data + '.length', grid.applyDataChanges));
Is there any function that I don't know?
I'm not sure what you're asking for. I can tell you that ng-grid will automatically update if your data changes if you declare your data object as a string referencing the name of your data object on your $scope. As mentioned in the getting started section here: http://angular-ui.github.io/ng-grid/ , the following would work:
$scope.myData = [{name: "Moroni", age: 50},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34}];
$scope.gridOptions = { data: 'myData' };
If at any point afterwords you changed the $scope.myData array, the grid would update accordingly.
This looks to have a reasonable resolution on it, and no action for some time. Closing.