05-22-2011 10:49 PM
There's ListEvent.ITEM_CLICKED event for clicking on the cell. In most the cases, it's good enough to handle the list select event. But if I have two buttons in every cell, I need a better way to detect the click event.
Here's the issues:
1. ICellRenderer doesn't have the reference to the list it belongs to, so I cannot send message to the list directly when the click event happens
2. The List doesn't seem to have the references to all the cells(it only knows lastVisibleCell and firstVisibleCell), so it cannot add event listens to every cell for my custom event from the cell.
Anyone have any suggeston how to do this?
Thanks
05-23-2011 12:55 AM
- On Mouse down each renderer processes the target, decides it's "clickAction" and stores that as a public var.
- When your list is clicked, look at the the renderer to see what it's clickAction is.
05-23-2011 09:59 AM
Is it possible that the list click event comes earlier than the events in cell renderer?
05-23-2011 10:22 AM
I set the event priority to int.MAX, but the list event still came first...
05-23-2011 10:40 AM
Sorry shawnblais, I didn't see you said mouse down instead of mouse click, that works. Thanks a lot