2

rikulo.org has great example for list-view at
http://rikulo.org/resource/js/examples/index-list.html

In this example, how can I detect the selected items in the list?
For example, how do I know 'Row 5' is selected if I click or touch on 'Row 5' ?

TheCodeArtist
  • 21,479
  • 4
  • 69
  • 130
bboona
  • 29
  • 1

2 Answers2

0
  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.

simonpai
  • 756
  • 1
  • 5
  • 4
0

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

duy
  • 579
  • 5
  • 16