Skip to Content
0

Open Menu when you Right Click on a Table Cell

Nov 13, 2017 at 05:46 PM

181

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Dec 06, 2017 at 04:23 AM
0

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)

Share
10 |10000 characters needed characters left characters exceeded
Sharath M G Nov 14, 2017 at 07:25 AM
0

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.js

Regards,

Sharath

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0