cancel
Showing results for 
Search instead for 
Did you mean: 

Open Menu when you Right Click on a Table Cell

0 Kudos

I need a context menu to appear when I right click on a row. I need to pick some data from the row to pass as a parameter in the context menu options/links. I use sap.ui.table.

In short I need the functionality of cellClick attribute that works when the user right clicks on a cell.

Any idea, how I can achieve this?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I was able to solve this issue by using the cellContextmenu event of sap.ui.table (https://sapui5.hana.ondemand.com/#/api/sap.ui.table.Table/events/cellContextmenu)

Answers (1)

Answers (1)

Sharathmg
Active Contributor

Hello,

Right click does not have any unique event assigned. Generally, mouse events are click, mouse up/down etc.

For right-click, you have a workaround. The details are shared in the below link:

https://stackoverflow.com/questions/2405771/is-right-click-a-javascript-event

Use the menu actions assignment in the sample from below link:

https://sapui5.hana.ondemand.com/#/sample/sap.ui.table.sample.RowAction/code/Controller.controller.j...

Regards,

Sharath

0 Kudos

I could get it done by using the cellContextmenu event of sap.ui.table. Thanks for your help though 🙂