2017-04-10 59 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(); });

,不建議使用到觀察家實現的功能。而是使用函數。