edvin / tornadofx

Lightweight JavaFX Framework for Kotlin
Apache License 2.0
3.68k stars 272 forks source link

TableView disable column resizing/reordering #908

Open dustincjensen opened 5 years ago

dustincjensen commented 5 years ago

In a table view is it possible to completely disable the headers? There are a couple of things I can't seem to figure out, or they might be missing as options.

Following is the table view I have replicating this.

override val root = tableview(categoriesModel.categories) {
    makeIndexColumn("", 1)
        .fixedWidth(30.0)

    readonlyColumn("Name", Category::name) {
        isSortable = false
        weightedWidth(1.0)
    }

    smartResize()
}
edvin commented 5 years ago

The TableView is a JavaFX control, so it's functionality is not affected by TornadoFX except in areas where we've added functionality to it. We have not made any improvements to the areas you mention here. There are hacks to remove the header, I found this on StackOverflow:

runLater {
    lookup("TableHeaderRow")?.let {
        it as Pane
        it.minHeight = 0.0
        it.maxHeight = 0.0
        it.prefHeight = 0.0
        it.isVisible = false
    }
}

The resize cursor issue sounds like a bug, so you might want to report that to the OpenJFX project.