gpt4 book ai didi

angular - 当用户单击 ng2-smart-table 中的 'add new' 时禁用单元格

转载 作者:行者123 更新时间:2023-12-04 01:38:40 25 4
gpt4 key购买 nike

我的设置如下。
当我单击“添加新”链接时,ID 单元格是可编辑的。我们想让该字段不可编辑。

mySettings = {
columns: {
id: {
title: 'ID',
editable: false,
},
name: {
title: 'Name',
},
lastname: {
title: 'Last Name',
},
}
};

最佳答案

找到了这个问题的解决方案。
我们需要添加一个属性 addable: false到受人尊敬的专栏。 ng2-smart-table 文档中没有提到这个属性。

tableSettings = {
mode: 'inline',
columns: {
name: {
title: 'Name',
editable:false,
addable: false,
},
lastname: {
title: 'Last Name',
},
} // columns
}

我在他们的示例 basic-example-load 中找到了这个解决方案。
https://github.com/akveo/ng2-smart-table/blob/master/src/app/pages/examples/server/basic-example-load.component.ts

关于angular - 当用户单击 ng2-smart-table 中的 'add new' 时禁用单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48403982/

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