但是,当我选中x,y或z复选框时,“Type”列中的downdrop值会发生变化
{ name: 'Type', displayName: 'Type', width: '7%',field:'getType()', editableCellTemplate: 'ui-grid/dropdownEditor',
editDropdownValueLabel: 'Type', enableCellEdit: true },
答案 0 :(得分:0)
应该这样做......
$scope.updateType = function (entity, type) {
entity.xBox = type == 'x';
entity.yBox = type == 'y';
entity.zBox = type == 'z';
}
editableCellTemplate: '<select ui-grid-edit-dropdown ng-init="result=row.entity.getType()" ng-options="type for type in [\'x\',\'y\',\'z\']" ng-model="result" ng-change="grid.appScope.updateType(row.entity, result)"></select>'
您的Plunker已更新,https://plnkr.co/edit/SbZkKubGtrzWYJhc8Qv9?p=preview。