Hi.
Is there a way to prevent the user from switching the position of tableview columns?
Normally it wouldn't be a problem, but when I try to retrieve data from textfields inside the table, I retrieve it in as an array object, and if the position is altered, then I'll get the wrong item:
B4X:
Dim row() as Object = MyTable.Items.Get(0)
Dim txf as TextField = row(1) 'The second column is expected to be the textfield, but it will be messed up if the user moves it.
Private Sub DisableReordering(TV As TableView)
Dim Jo As JavaObject = TV
Dim Header As JavaObject = Jo.RunMethod("lookup", Array("TableHeaderRow"))
Dim Prop As JavaObject = Header.RunMethod("reorderingProperty", Null)
Dim o As Object = Prop.CreateEventFromUI("javafx.beans.value.ChangeListener", "HeaderOrder", Null)
Prop.RunMethod("addListener",Array(o))
End Sub
Private Sub DisableReordering(TV As TableView)
Dim Jo As JavaObject = TV
Dim Header As JavaObject = Jo.RunMethod("lookup", Array("TableHeaderRow"))
Dim Prop As JavaObject = Header.RunMethod("reorderingProperty", Null)
Dim o As Object = Prop.CreateEventFromUI("javafx.beans.value.ChangeListener", "HeaderOrder", Null)
Prop.RunMethod("addListener",Array(o))
End Sub
This library extends TableView and provides more control on the columns, rows and cells. What you get with TableView: What you can get with TableViewExtended (with the same data): You can easily enhance an existing TableView by initializing your TableViewExtended with...