How do I disable the context menu and prevent it from showing if the user right clicks on a column header or row header or on a selection of multiple cells? I only need the context menu to be displayed if the user right clicks on a single table cell that isn’t a row/column header.
One of the approaches it to block the options via
hidden option in the menu http://jsfiddle.net/handsoncode/npbs31d0/
where you compare
The second one is using the
contextMenu: false in the
You can also pass the
beforeOnCellContextMenu and that might me the best and simplest way to fo it.
Both these methods work perfectly for me, thank you!
However, I have a question about using
CellCoords returns the row and column intersect of a single cell when right clicking on a single cell or when right clicking on an area of multi-selected cells. Is there a way to get the entire area cell coordinates when highlighting an area rather than just the single cell coordinate that CellCoords parameter provides?
Having the area cell coordinates would be helpful in disabling the context menu option if the user has highlighted multiple cells.
Thanks for all the help!
console.log(this.getSelectedLast()) in the
this is an instance of Handsontable.
You’re welcome. I keep my fingers crossed for the project.