Before Seth's useful response, I cam up with another approach. This uses a single on-click event at the table level, and adds a data-id attribute to the row. Any comments on which approach is better, or if there is a more standard 'Dartful' approach I should be using, would be much appreciated!
<template if="showSiteList == true">
<table class="table-select" id="sitelist2" on-click="tableClicked($event)">
<thead>
<tr><th>Choose a site</th>
</tr>
</thead>
<tbody template iterate="x in siteCells">
<tr data-id={{x[0]}} > <td> {{x[1]}} </td>
</tr>
</tbody>
</table>
</template>
And the Dart code:
void tableClicked(Event e) {
TableCellElement cell = e.target;
TableRowElement row = cell.parent;
if (row.dataAttributes.containsKey('id')) {
int id = int.parse(row.dataAttributes['id']);
if (id != null) { // be a bit paranoid
globSiteId = id;
}
}
showSiteList = false;
watchers.dispatch();
}