Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private b4xtable1 As B4XTable
Private GraphColumn As B4XTableColumn
Private progress As ProgressBar
End Sub
public Sub zhichuchaxun
GraphColumn = b4xtable1.AddColumn("总进度", b4xtable1.COLUMN_TYPE_TEXT)
GraphColumn.Sortable = False
GraphColumn.Searchable = False
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("select_chaxunzhichu", Array("001"))
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)
Dim data As List
data.Initialize
For Each row() As Object In res.Rows
....
For i = 1 To GraphColumn.CellsLayouts.Size - 1
Dim p As B4XView = GraphColumn.CellsLayouts.Get(i)
Dim Base As B4XView = xui.CreatePanel("")
p.AddView(Base, 2dip, 2dip, GraphColumn.Width - 4dip, b4xtable1.RowHeight - 4dip)
Base.LoadLayout("progress")
Base.Tag = progress
Next
Sub B4XTable1_DataUpdated
For i = 0 To b4xtable1.VisibleRowIds.Size - 1
Dim RowId As Long = b4xtable1.VisibleRowIds.Get(i)
Dim p As B4XView = GraphColumn.CellsLayouts.Get(i + 1)
Dim pro As ProgressBar = p.GetView(1).Tag 'Base panel is the 2nd view
If RowId > 0 Then
Dim row As Map = b4xtable1.GetRow(RowId)
pro.Progress= row.Get("x")
End If
Next
End Sub