英文:
How to set column in table not editable
问题
你可以在UITable
中使一个或多个列不可编辑但仍可见,同时保持所有其他列可编辑吗?
UITable
的setEditable(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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论