Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kotlin 设置格式时,单元格值不再可编辑_Kotlin_Tornadofx - Fatal编程技术网

Kotlin 设置格式时,单元格值不再可编辑

Kotlin 设置格式时,单元格值不再可编辑,kotlin,tornadofx,Kotlin,Tornadofx,当我使用此处定义的cellFormat功能时 表中的“我的单元格”停止显示其值,并且不可编辑。 我的桌子看起来像: with(tradeTable) { enableCellEditing() columnResizePolicy = SmartResize.POLICY isEditable = true column("Id", TradeEntity::id)

当我使用此处定义的
cellFormat
功能时 表中的“我的单元格”停止显示其值,并且不可编辑。 我的桌子看起来像:

        with(tradeTable)
        {
            enableCellEditing()
            columnResizePolicy = SmartResize.POLICY
            isEditable = true
            column("Id", TradeEntity::id)
            column("Issue Date", TradeEntity::issueDate).makeEditable().cellFormat {
                style {
//                    if (it.dayOfMonth - LocalDate.now().dayOfMonth<=2 ) {
//                        backgroundColor+=c("#FFA500")
//                        textFill = Color.WHITE
//                    }
                }

            } ... more columns...
with(贸易表)
{
enableCellEditing()
columnResizePolicy=SmartResize.POLICY
isEditable=true
列(“Id”,TradeEntity::Id)
列(“发布日期”,TradeEntity::issueDate).makeEditable().cellFormat{
风格{

//如果(it.dayOfMonth-LocalDate.now().dayOfMonth我见过的所有示例都明确指定了
cellFormat
中的
text
属性,因此您应该将代码修改为:

column("Issue Date", TradeEntity::issueDate).makeEditable().cellFormat {
      style {
          // whatever 
      }
      text = it.toString() //possible transformations?
}

cellFormat
要求您指定单元格的
text
graphic
属性,否则不会显示任何内容。由于
cellFormat
安装了自己的
CellFactory
,因此它与
makeEditable()
直接竞争。如果您调用
makeEditable())
但是,您可以使用
cellDecorator
而不是
cellFormat
来进一步自定义单元格。

谢谢,这有助于显示值,但无法使其可编辑