2017-04-10 58 views

回答

1

您可以收听改变和更新$scope.myDatadiscount变化。因为ui-grid$scope.myData的双向绑定,它会更新视图。 您input标签看起来像:

<input class="form-control " data-ng-model="discount" ng-change="updateValues()" type="number"> 

然后添加updateValues功能,以您的$scope

$scope.updateValues = function() { 
    // write code to update values here 
} 
0

叉形你plunker用一些随机值改变“×(默认)”列的值。

代码:

angular.forEach($scope.myData,function(row,idx){ row.x = Math.random(); });

,不建议使用到观察家实现的功能。而是使用函数。