(Dartlang) How can I detect the selected item in the listview (Dartlang) How can I detect the selected item in the listview dart dart

(Dartlang) How can I detect the selected item in the listview


  1. You can listen to onClick events for each list item by

    item.on.click.add((ViewEvent event) { // do whatever you want, handle selection, add/remove CSS class, etc});

  2. Or add a checkbox within the list item, and listen to its onCheck event.

Note that Rikulo is under rapid development now and will add more construction. There will be a model driven list view that handles selection.


It works for me:

document.onClick.listen((MouseEvent e){   TableRowElement row = e.toElement;   print(row.text); });

You can change document to : query("#table"), queryAll("tr"),ect