Angularjs DevExtreme网格-编辑模式
tvaLst=[{ id:1, taux:5, 是的}, {id:2, taux:13.01, 奥立:错 }]; 假设我从一个服务中检索到上面的对象列表,并且我希望在第二列中显示taux值,并且仅显示属性ole设置为true的行的编辑和删除选项Angularjs DevExtreme网格-编辑模式,angularjs,devextreme,Angularjs,Devextreme,tvaLst=[{ id:1, taux:5, 是的}, {id:2, taux:13.01, 奥立:错 }]; 假设我从一个服务中检索到上面的对象列表,并且我希望在第二列中显示taux值,并且仅显示属性ole设置为true的行的编辑和删除选项 this.gridSettings = { bindingOptions: { dataSource: 'vm.tvaLst' }, allowColumnResizing: true, scrolling: { mode: 'virt
this.gridSettings = {
bindingOptions: { dataSource: 'vm.tvaLst' },
allowColumnResizing: true,
scrolling: { mode: 'virtual' },
onContentReady: this.contentReadyAction,
paging: { enabled: false },
editing: {
mode: "row",
allowUpdating: true,
allowDeleting: true,
allowAdding: true
},
columns: this.gridColumns
};
在编辑时,我应该做什么来允许此操作?您可以在事件处理程序中找到并隐藏“编辑”按钮 下面是一个示例代码:
onCellPrepared: function (options, $container) {
if (options.column && options.column.command === "edit" && options.rowType == "data") {
if (options.cellElement.find('a').first().text() === 'Edit') {
if (options.data.ole === false){
options.cellElement.find('a').first().hide();
options.cellElement.find('a').eq(1).hide();
}
}
}
}
以下是在线示例: