Chapter 02 · Dart + browser APIs

A table is just a bound model.

Bind JSON columns and rows to a real HTML table. Row click and keyboard selection flow through a registered JavaScript handler.

Template column
Waiting for table.json

No row selected.

Loading the Dart application…

How it works

The HTML is a static template. JSON supplies values or drawing data. Dart owns rendering and browser events; boot.js registers small JavaScript handlers through LMDart.register.

final table = JsonTable(await fetchJson('data/table.json'));
table.bind(tableElement, (index) {
  bridge.call('table.selected', {'index': index}.jsify());
});