Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs DevExtreme网格-编辑模式_Angularjs_Devextreme - Fatal编程技术网

Angularjs DevExtreme网格-编辑模式

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

tvaLst=[{ id:1, taux:5, 是的}, {id:2, taux:13.01, 奥立:错 }];

假设我从一个服务中检索到上面的对象列表,并且我希望在第二列中显示taux值,并且仅显示属性ole设置为true的行的编辑和删除选项

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();
            }
        }
    }
}
以下是在线示例: