Large JSON performance

Good afternoon (o;

What is the best or preferred way to load a large JSON via HTTPS and display it with custom cells as table?

Currently using something like this which works fine for a small JSON:

For Each d As Dictionary In orders
  Var cell As MobileTableCellData = OrdersTable.CreateCustomCell(GetTypeInfo(OrderCell))
  Var container As OrderCell = OrderCell(cell.Control)
  Var firstname as String = d.Value("Vorname")
  container.LabelOrderID.Text = d.Value("ID")
  container.LabelDate.Text = d.Value("Datum")
  container.LabelName.Text = firstname.LeftBytes(1) + ". " + d.Value("Nachname")
  container.LabelOrt.Text = d.Value("PLZ") + " " + d.Value("Ort")
  container.LabelPreis.Text = "CHF " + d.Value("Betrag")
  OrdersTable.AddRow(0, cell)


But as there are over 20’000 rows this approach goes onto his knees already at 2000 rows whereas my datatables web application only needs 1 second to pull in all rows…

Is there something like lazy loading?

thanks in advance

You will definitely need to use a datasource to handle a large amount of cells.
See Xojo Examples > iOS > Controls > Table > TableDataSourceDatabase

When using a datasource, only the visible rows are loaded by the Table.

Ah okay…but still the whole JSON is loaded?

When I load the whole JSON with over 20000 orders with wget on my Mac it takes less than 0.3 seconds from Germany to Switzerland :wink:

Would then searching work as well on the whole JSON even with elements not visible in the table?

But a nice project to test this weekend :wink: