Diego Ledesma
Diego Ledesma

Reputation: 1372

How to detect right click for an item in a listview in Javascript Metro application

I'm trying to find which event is triggered when you right click an item in a listview. When I right an item it marks it as selected but I can't seem to find which event is triggered.

I have attached a function to the oniteminvoked event, which is triggered correctly when I left-click an item but not when I right-click it.

Which event is triggered when I right-click an item?.

Thanks.

Upvotes: 2

Views: 1853

Answers (2)

For what it's worth, you should also see a selectionchanging and selectionchanged event since the listview.selection property will be updated. This is a ListView event, not an item event, but might be useful depending on what you're trying to accomplish.

Upvotes: 1

JP Alioto
JP Alioto

Reputation: 45127

You should use the AppBar object to give your users a right click experience. See Commanding Design for Metro Style Apps. That said, you could listen for contextmenu ...

object.addEventListener("contextmenu", handler, useCapture)

Upvotes: 0

Related Questions