B4J Question go to the primitive records When the record is clicked tabel view

alirezahassan

Active Member
Licensed User
Longtime User
what do you mean with primite records? how are you filling the tableview?
if i clicked to Check Box, i wanna to the record goes to the top of the record it's like the B4J
 
Upvote 0

EnriqueGonzalez

Expert
Licensed User
Longtime User
following code assumes that you:
1. the checkbox lives within the rows of the tableview
2. the checkbox tags holds the information of the row index it lives in
B4X:
private Sub checkbox_CheckedChange(Checked As Boolean)
    Dim chk As CheckBox = Sender
    
    Dim index As Int = chk.Tag
    Dim arr() As Object = tw.Items.Get(index)
    
    tw.Items.RemoveAt(index)
    If Checked Then
        tw.Items.InsertAt(0,arr)
    Else
        tw.Items.InsertAt(tw.Items.Size -1,arr)
    End If
End Sub
hope it helps.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…