获取更改的字段

时间:2015-06-26 19:29:21

标签: angularjs angular-ui-grid

我有ui-grid并在其中进行了一些编辑,因此绑定到网格中的data会发生变化。将更改的数据推送回服务器有什么好的解决方案?我认为最好是只改变行,甚至改变字段。我如何在AngularJs中实现这一目标

1 个答案:

答案 0 :(得分:0)

看看

$scope.gridOptions.onRegisterApi = function(gridApi){ //set gridApi on scope $scope.gridApi = gridApi; gridApi.edit.on.afterCellEdit($scope,function(rowEntity, colDef, newValue, oldValue){ $scope.msg.lastCellEdited = 'edited row id:' + rowEntity.id + ' Column:' + colDef.name + ' newValue:' + newValue + ' oldValue:' + oldValue ; $scope.$apply(); }); };

您可以在此处轻松附加任何ajax电话。

http://ui-grid.info/docs/#/tutorial/201_editable

相关问题