Good day!
I'm trying to build hierarchical widget with YUI3 Widget-parent and widget-child and currently studying Hierarchical ListBox Widget.
I want to subscribe only to click event of the particular child that was clicked. Continuing usage example from the above page, I'm doing:
listbox.on("listbox:click", function(e) {...});
Now when I click on the "Item Three - Two" entry in the list, this event gets fired for "Item Three - Two", "Item Three" and root widgets. Inside that event handler, I've found no way to determine whether e.target is the original widget I've clicked on or one if its parents.
So my questions are:
Thank you.
If you're just wanting to get the leaf node as e.target
use:
listbox.on('option:click', function (e) {...
Subscribing to the listbox:click
actually doesn't pick up the leaf node in my example, but it picks up the click for the two parent listbox
ancestor widgets.