Sub mounted
app.PagePause
'Show loading indicator
tblcountries.RefreshLoading = True
Dim j As SDUIFetch
j.Initialize("https://restcountries.com/v2/all")
banano.Await(j.GetWait)
Dim countriesL As List
countriesL.Initialize
If j.Success Then
Dim Response As List = j.ToList
For Each c As Map In Response
Dim nm As Map = SDUIShared.MapCopyKeys(c, Array("area","capital","flag","name","population","languages","latlng","callingCodes"))
Dim scallingcode As String = SDUIShared.MapJoinKey(nm, "callingCodes", ",")
Dim slanguages As String = SDUIShared.MapJoinKey(nm, "languages.name", ",")
nm.Put("callingcode", scallingcode)
nm.Put("languages", slanguages)
countriesL.Add(nm)
Next
End If
banano.Await(tblcountries.SetItemsPaginate(countriesL))
'sum the totals of each of these columns
Dim summary As Map = tblcountries.SetFooterTotalSumCountColumns(Array("population"))
spopulation = summary.Get("population")
'get the total number of processed rows
srowcount = summary.Get("rowcount")
'format the value to be a thousand
srowcount = SDUIShared.Thousands(srowcount)
'merge these columns
tblcountries.SetFooterColumnsMerge(Array("name","flag"))
'set the first column to show the total
tblcountries.SetFooterColumn("name", $"Total (${srowcount})"$)
'Hide loading indicator
tblcountries.RefreshLoading = False
app.PageResume
End Sub