Context: This is a Windows 8 Metro application question based on their HTML / JS framework.
I want to put one or two of the most common secondary actions in a template for my items in a ListView. Think of a music player. Clicking on the name immediately plays the track, but I also want the "Add to playlist" button on each line.
When I add a button inside my template, even if I add a handler for this button, the onItemInvoked function for the ListView is always called, and the button handler will never be called. It would be nice if I could identify from onItemInvoked CustomEvent which element was clicked, however the target and sourceElement are always the external div of the template and were never actually clicked.
Does anyone have any suggestions on how I can do this? I saw samples for selecting an item and presenting additional options in the application panel, but for something usually used as "Add to playlist", which just would be a bad user interface.
source share