简体   繁体   English

更改 NatTable 颜色

[英]Changing the NatTable color

I am trying to grey-out/disable the entire NatTable upon a if condition.我试图在 if 条件下使整个 NatTable 变灰/禁用。 What I'm trying to achieve here is similar to the setenabled(false) function in a regular table.我在这里尝试实现的功能类似于常规表中的 setenabled(false) 函数。

So Far I have found out that the configRegistry needs to be changed it must be added to the NatTable but i'm unsure how to proceed with this.到目前为止,我发现 configRegistry 需要更改,它必须添加到 NatTable 中,但我不确定如何继续。

Styling in NatTable is done via the ConfigRegistry. NatTable 中的样式是通过 ConfigRegistry 完成的。 Typically this is done at creation time or conditionally via config labels.通常这是在创建时完成或通过配置标签有条件地完成。 In your use case you need to programmatically access the ConfigRegistry via NatTable#getConfigRegistry() and change the base styles via API.在您的用例中,您需要通过NatTable#getConfigRegistry()以编程方式访问 ConfigRegistry 并通过 API 更改基本样式。

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

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