如何设置表中的列为不可编辑

huangapple go评论84阅读模式
英文:

How to set column in table not editable

问题

你可以在UITable中使一个或多个列不可编辑但仍可见,同时保持所有其他列可编辑吗?

UITablesetEditable(false)方法适用于整个表格,而不是仅适用于单个列?

英文:

Can I make one or more columns in an UITable not editable but still visible, while all other Columns remain editable?

The setEditable(false) method of UITable works for the whole table, not for just a single column?

答案1

得分: 2

"UITable"仅是一个元素。如果使用"UIEditor",列也应该被禁用。模型将处理一切:

dataBook.getRowDefinition().getColumnDefinition("COLUMN_NAME").setReadOnly(true);

该模型通知表中的所有编辑器和单元格。因此,上述方法调用足以更改模型,所有UI控件将自动正确。

英文:

The UITable is only one element. If you use an UIEditor the column should also be disabled. The model will handle everything:

dataBook.getRowDefinition().getColumnDefinition("COLUMN_NAME").setReadOnly(true);

The model notifies all editors and cells in a table. So above method call is enough to change the model and all UI controls will be correct automatically.

huangapple
  • 本文由 发表于 2023年5月10日 17:02:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76216634.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定