Skip to Content

Open Menu when you Right Click on a Table Cell

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 06, 2017 at 04:23 AM

    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)

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 14, 2017 at 07:25 AM

    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

    Add comment
    10|10000 characters needed characters exceeded