I have a table as follows:
with(myTable)
{
enableCellEditing()
columnResizePolicy = SmartResize.POLICY
isEditable = true
column("Issue Date", TradeEntity::issueDate).makeEditable().cellFormat { tc ->
style { if (tc.dayOfMonth==10) backgroundColor += Color.ORANGE }
text = tc.toString()
}
I cannot make this editable AND having a style. It's either I have a style, either it's editable... Any help?
EDIT Solved, at least in Java, I guess it's all because I didn't call super.updateItem(it,empty)
in Kotlin
答案 0 :(得分:2)
cellFormat
时, CellFactory
会替换已安装的makeEditable()
,因此他们会互相直接竞争。出于这个原因,TornadoFX提供了cellDecorator
,它保留了现有的CellFactory
:
column("First Name", Customer::firstNameProperty) {
makeEditable()
cellDecorator {
style {
fontWeight = FontWeight.BOLD
}
}
}