嗨,我試圖避免角度ui網格中的名稱重複。如何更新角度ui網格中的相應行
$scope.gridOptions.columnDefs = [
{ name: 'id', width: '25%' },
{ field: 'name',
displayName: 'Name',
width: '25%',
height:'auto',
'cellTemplate':'<div><input type="text" ng-class="{error:grid.appScope.hasError(row.entity)}" ng-change="grid.appScope.objectHasChanged(row.entity)" ng-input="row.entity.name" ng-model="row.entity.name" /><div class="errorspan" ng-show="grid.appScope.hasError(row.entity)" >Error in field</div></div>'
},
{ name: 'gender', displayName: 'Gender', editableCellTemplate: 'ui-grid/dropdownEditor', width: '20%',
cellFilter: 'mapGender', editDropdownValueLabel: 'gender', editDropdownOptionsArray:
[
{ id: 1, gender: 'Male' },
{ id: 2, gender: 'Female' }
]
},
{
field: 'status',
cellTemplate: '<div ng-if="row.entity.status == 0">Active</div><div ng-if="row.entity.status == 1">InActive</div>'
}
];
這裏是我的plunker:http://plnkr.co/edit/PlUfwRGEezYQVMpXmiIr?p=preview
問題是與它打開所有其他行也。
我在做什麼錯了?有沒有辦法只更新到特定的行?