Lars Erik Rojeras
08/21/2020, 1:16 PMpackage com.example
import pl.treksoft.kvision.panel.SimplePanel
import pl.treksoft.kvision.state.observableListOf
import pl.treksoft.kvision.tabulator.ColumnDefinition
import pl.treksoft.kvision.tabulator.Editor
import pl.treksoft.kvision.tabulator.Layout
import pl.treksoft.kvision.tabulator.TabulatorOptions
import pl.treksoft.kvision.tabulator.tabulator
import pl.treksoft.kvision.utils.px
data class Employee(
val name: String?
) {
companion object {
internal var counter = 0
}
}
class TabulatorTab : SimplePanel() {
val data = observableListOf(
Employee(
"Tiger Nixon"
),
Employee(
"Garrett Winters"
),
Employee(
"Ashton Cox"
)
)
init {
this.marginTop = 10.px
tabulator(data,
options = TabulatorOptions(
layout = Layout.FITCOLUMNS,
columns = listOf(
ColumnDefinition(
"Name 1",
"name",
headerFilter = Editor.INPUT,
headerFilterPlaceholder = "Text 1"
)
)
)
)
tabulator(data,
options = TabulatorOptions(
layout = Layout.FITCOLUMNS,
columns = listOf(
ColumnDefinition(
"Name 2",
"name",
headerFilter = Editor.INPUT,
headerFilterPlaceholder = "Text 2"
)
)
)
)
}
}
When I run this example I expect the second table to have a filter field with a placeholder "Text 2". But, instead "Text 1" is displayed. Why is that?Robert Jaros
08/21/2020, 4:15 PMconsole.log
with jsTabulator.options
I can see correct placeholder text.
It must be cached somehow with the field name. If I add another field to the data class and change the field name for the second table it will be ok.Robert Jaros
08/21/2020, 4:17 PM