Hello,
I had to use a wraplabel to show my text in a tableview because I want to align my data in the cells.
But now when I click the header column to do the sort, the sorting is not done.
Is this because I use a wraplabel?
Greets John
I had to use a wraplabel to show my text in a tableview because I want to align my data in the cells.
But now when I click the header column to do the sort, the sorting is not done.
B4X:
Sub WrapLabel(lbl As Label, Alignment As String) As Pane
Dim pn1 As AnchorPane
pn1.Initialize("")
pn1.AddNode(lbl, 0, 0, -1, -1)
pn1.FillHorizontally(lbl, 0, 0)
Dim jo1 = lbl As JavaObject
jo1.RunMethod("setAlignment", Array As Object(Alignment))
Return pn1
End Sub
Sub FillArmTable()
tblArm.Items.Clear
Dim rs As ResultSet
rs = sqlUurrooster.ExecQuery("select * from tblalarm_arm order by id")
Do While rs.NextRow
Dim row(5) As Object
Dim lblId As Label
lblId.Initialize("")
lblId.Text = rs.GetString("id")
row(0) = WrapLabel(lblId, "CENTER_RIGHT")
Dim lbltijdUurrooster As Label
lbltijdUurrooster.Initialize("")
lbltijdUurrooster.Text = rs.GetString("uurroostertijd")
row(1) = WrapLabel(lbltijdUurrooster, "CENTER")
Dim tblTijdZone1 As Label
tblTijdZone1.Initialize("")
tblTijdZone1.Text = rs.GetString("tijd_zone1")
row(2) = WrapLabel(tblTijdZone1, "CENTER_RIGHT")
Dim tblTijdZone2 As Label
tblTijdZone2.Initialize("")
tblTijdZone2.Text = rs.GetString("tijd_zone2")
row(3) = WrapLabel(tblTijdZone2, "CENTER_RIGHT")
' 'the second item will be later edited by the user. To allow it to be updated we use a label.
' Dim btnDeleteArm As Button
' btnDeleteArm.Initialize("btnDeleteArm")
' btnDeleteArm.Text = "Wis"
' btnDeleteArm.Font = fx.DefaultFont("10")
' btnDeleteArm.SetSize(35,7)
'
' row(4) = btnDeleteArm
tblArm.Items.Add(row)
Loop
rs.Close
End Sub
Is this because I use a wraplabel?
Greets John
Last edited: