B4J Question How can the treetable achieve the effect of vsflexgrid tree like in VB6

guandjy

Member
1704379313397.png

B4X:
Sub AddFolder(Parent As TreeTableItem, Folder As String)
    Dim req As DBRequestManager = CreateRequest
    Dim cmd As DBCommand = CreateCommand("select_chaxunzhichu", Array("chaxun"))
    Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
    If j.Success Then
        req.HandleJobAsync(j, "req")
        Wait For (req) req_Result(res As DBResult)
        req.PrintTable(res)
        For Each row() As Object In res.Rows
            Dim val1 As String = row(res.Columns.Get("colum1"))
            Dim val2 As String = row(res.Columns.Get("colum2"))
            Dim val3 As int = row(res.Columns.Get("number"))
            data.Add(Array(val3,val1,val2))
            
            Dim tti As TreeTableItem
            tti.Initialize("tti", Array(val1, val2, val3))
            Parent.Children.Add(tti)
 
            tti.Expanded = False
            
        Next

    Else
        Log("ERROR: " & j.ErrorMessage)
    End If
    j.Release

End Sub
 

guandjy

Member
The content in the table is classified and summarized according to the first three columns, and then summed up,B4xtable doesn't seem to have such a feature, making treetable so difficult
 
Upvote 0
Top