gpt4 book ai didi

angular - 农业网格 : Disable cell edit on key press and pro grammatically enable row edit with edit button (Angular 2)

转载 作者:行者123 更新时间:2023-12-02 20:35:17 28 4
gpt4 key购买 nike

我在每一行都有一个编辑按钮,我已经设置了

  defaultColDef: {
editable: false,
}

在网格选项中

当我点击编辑按钮时,我希望该行处于编辑模式。如果我设置

,我的编辑按钮工作正常
  defaultColDef: {
editable: true,
}

但它启用了我不想要的按键编辑。

我应该如何在不将我的 defaultColdef 中的 editable 设置为 true 的情况下动态编辑该特定行?

点击编辑后,我启用了 this.gridOptions.defaultColDef.editable = true,但没有成功!

最佳答案

在定义 columnDefs 时,给出 editable: false

单击编辑按钮时,要动态编辑行中的特定列/单元格,请使用:

this.GridOptions.columnApi.getColumn('employeeName').getColDef().editable = true;

完成编辑后使用:

 this.GridOptions.columnApi.getColumn('employeeName').getColDef().editable = false;

关于angular - 农业网格 : Disable cell edit on key press and pro grammatically enable row edit with edit button (Angular 2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47344849/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com