我已经绞尽脑汁,但无法弄清楚如何检测ng-grid中的细胞数据变化.
下面的代码片段正在使用ng-change,它正确调用save(),但它不是
触发器我想要因为它被调用任何键控条目.我需要知道什么时候编辑
细胞完整.
下面的代码片段正在使用ng-change,它正确调用save(),但它不是
触发器我想要因为它被调用任何键控条目.我需要知道什么时候编辑
细胞完整.
任何帮助,将不胜感激.
angular.module('controllers',['ngGrid']). controller('ContactsListCtrl',['$scope','Contacts',function ($scope,Contacts) { var editableCellTemplate = '<input type="text" ng-class="\'colt\' + col.index" ng-input="COL_FIELD" ng-model="COL_FIELD" ng-change="save()"/>'; Contacts.get(function(data) { $scope.contacts = data; }); $scope.gridOptions = { data: 'contacts',enableCellSelection: true,enableRowSelection: false,enableCellEdit: true,showSelectionCheckBox: true,columnDefs: [ {field: 'lastName',displayName: 'Last Name',editableCellTemplate: editableCellTemplate},{field: 'firstName',displayName: 'First Name',{field: 'email',displayName: 'EMail Address',{field: 'phone',displayName: 'Phone',editableCellTemplate: editableCellTemplate} ] }; $scope.save = function() { $scope.contact = this.row.entity; Contacts.save($scope.contact); } }]);
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。