Friday, 23 August 2013

In WinJS how to avoid outer div event handler affects inner div event handler

In WinJS how to avoid outer div event handler affects inner div event handler

I want to set different event handlers on nested divs, and the events are
both triggered by right-click. Both event handlers would draw different
buttons on the same area.
My code would be like this:
<div id="a">
<div id="b data-win-control="WinJS.UI.ListView">
...
</div>
</div>
I addEventListener on "div a" and "listview", the problem is that while I
right-click on listView elements, triggering listView's event handler
first, and then a's event handler which will override listView's effects.
How to avoid triggering a's event handler when right-click on listView?
Thanks

No comments:

Post a Comment