简体   繁体   English

PrimeNg 数据表列禁用

[英]PrimeNg Datatable Column Disable

I am using Primeng Datatable.我正在使用 Primeng 数据表。 Also using [(selection)] ="selectedRowItems" in <p-dataTable...> to multiple check/uncheck etc. I'd like to modify this datatable checkbox-column in such a way that if some certain condition is given then the column will be disabled else enabled.还使用[(selection)] ="selectedRowItems"<p-dataTable...>进行多次检查/取消检查等。我想以这样的方式修改此数据表复选框列,如果给出了某些特定条件,则该列将被禁用,否则将被启用。

In short: Is there any boolean property like [disabled] available for Primeng Datatable to disable/enable a column?简而言之:Primeng Datatable 是否有像 [disabled] 这样的布尔属性来禁用/启用列?

More clarification: I would like to display some Item details in datatable.更多说明:我想在数据表中显示一些项目详细信息。 If their parent Id's status is 'Deployed', then the checkbox column will be disabled.如果其父 ID 的状态为“已部署”,则复选框列将被禁用。 But if the parent Id's status is not 'deployed' then the checkbox column will be active and we can add/delete/modify items in datatable.但是如果父 ID 的状态不是“已部署”,那么复选框列将处于活动状态,我们可以在数据表中添加/删除/修改项目。 This parent Id, or the status is not part of data-table.此父 ID 或状态不是数据表的一部分。 Only the item details shown.仅显示项目详细信息。

in .html :.html

[selectionMode] = "multipleOrnull" [selectionMode] = "multipleOrnull"

in .ts :.ts

if(deployed){
   multipleOrnull = "";
} 
else {
    multipleOrnull = "multiple";
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM