Context menu items

Tags: #<Tag:0x00007f0b02be9ec0>

Hi,

We would like to have different context menu options for rows and headers. For example, right click on the row will have a certain pre-defined context menu items and right click on header will have other pre-defined context menu items. Is this possible?

Hi @kaveh.shams

context menu and dropdown menu are fully adjustable. You can mix predefined options with your implementations.

Here http://jsfiddle.net/AMBudnik/nv302fjb/ is an example where we use make_read_only key which enabled the default readOnly functionality. You just use the predefined key (which are listed here https://handsontable.com/docs/7.4.2/demo-context-menu.html) and pass an empty object as a value.

Next in the demo, we have two custom options. They only console some values but you can see that one of them uses hidden key which hides it for some cells.

I hope it helps, but if you have any questions feel free to leave a comment.

Thanks @aleksandra_budnik, this is helpful. Is there a way I can identify if the right click is on the header cell and not the data cell so that I can show the filter option in context menu? The business has asked to remove the header drop down for filter if possible.

In other words, is it possible to have the below options in contextMenu and not dropdownMenu.

‘filter_by_condition’,
‘filter_operators’,
‘filter_by_condition2’,
‘filter_by_value’,
‘filter_action_bar’

?

Unfortunately, the context menu does not understand filter keys. Those are made for the dropdownMenu structure like here http://jsfiddle.net/AMBudnik/vgj93fum/

Thanks @aleksandra_budnik