Hi, I am trying to load data to B4XTable, but am not able to. I'm sure, I'm doing it the wrong way.
I'm using the code below.
I'm using the code below.
B4X:
Case "FetchAllServices"
' Try
Log("------------------------->")
Dim JobsList As List
JobsList = parser.NextArray 'returns a list with maps
Dim id,service,status,date,time As String
Dim dataList,mlit As List
dataList.Initialize
mlit.Initialize
mlist.clear
B4XTable1.Clear
For i = 0 To JobsList.Size - 1
Dim m As Map
m = JobsList.Get(i)
id = m.Get("id")
service = m.Get("service")
mlist.Add(service)
date = m.Get("dayslot")
dataList.Add(m.Get("id"))
dataList.Add(m.Get("service"))
time = m.Get("timeslot")
'Log(i & ".] Services" & service)
Next
spnrservices.SetListItems(mlist)
ComboBox1.Value = ""
ComboBox1.Items.AddAll(mlist)
ComboBox1.SelectedIndex = 0
Log(dataList)
B4XTable1.AddColumn("ID", B4XTable1.COLUMN_TYPE_NUMBERS)
B4XTable1.AddColumn("Services", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.RowHeight = 22
B4XTable1.SetData(dataList)
B4XTable1.Refresh