我正在尝试禁用celledit以获取nggrid中的列:
$scope.gridOptions = {
data: 'myData',
enableCellSelection: true,
enableCellEditOnFocus:true,
enableRowSelection: false,
columnDefs: [{field: 'name', displayName: 'Name', enableCellEdit: true},
{field:'age', displayName:'Age',
cellTemplate: '<div ng-disabled=true ng-class="{green: row.getProperty(col.field) == row.getProperty(\'name\'),red:row.getProperty(col.field) != row.getProperty(\'name\')}"><div style="text-align:center;" class="ngCellText">{{row.getProperty(col.field)}}</div></div>'}]
};
我尝试过ng-disabled = true但它不起作用?这该怎么做? plunkr:http://plnkr.co/edit/nj57V6WcHJxN5OosvwYx?p=preview
答案 0 :(得分:0)
您可以尝试使用enableCellEdit: false
吗?
columnDefs: [{field: 'name', displayName: 'Name', enableCellEdit: false},