contextMenu options do not work or render strangely

Tags: #<Tag:0x00007f8b2b6eb910> #<Tag:0x00007f8b2b6eb758>

I’ve created a contextMenu using the built-in contextMenu API and I’ve added extra options from the documentation, but I’m having some issues with some of them.
For starters, the default contextMenu has an option for Remove column, but this is not present as an option for a custom contextMenu in the documentation. Instead, there is clear_column, which does not function the same way. I’ve tried just using remove_column the same way as remove_row, but this does not work.

Second, hidden_rows_hide and hidden_rows_show do not work and are just rendered as their contextMenu key instead of a normal label, see attached image.
image

I’ve tried looking around this forum as well as the GitHub issues but cannot see anyone experiencing a similar issue. Are these PRO features? I’m currently just using the non-commercial license. If they are, maybe that should be added to the documentation?

Hi @pretzL

You’re right. We skipped the remove_col in the documentation for the context menu. I will create an issue to add the option.

Then the hidden rows options only work if you enable the hiddenRows plugin, just like you did for the hiddenColumns.

Then, you have to know that Show row or Show column shows only if you select an area within those hidden rows/columns (just like on the pictures below)

Here’s a full demo https://jsfiddle.net/qL1x4zpy/

ps. By saying

Are these PRO features?

Do you mean, that you are using a version Handsontable CE 6.2.2 or older? Because Hidden Rows back then was only in the Pro package. It you are on any version above that (where v13.0.0 is the recent one) this should work for you.

Thank you for your reply.

I can confirm remove_col is working, although this is perhaps a little counter-intuitive considering the equivalent for row is remove_row (i.e. not abbreviated), and clearing is clear_column (also not abbreviated).

I seem to have forgotten to initialize the hiddenRows plugin, which is why those contextMenu options weren’t being rendered as intended, so thank you for that.

ps. By saying

Are these PRO features?

Do you mean, that you are using a version Handsontable CE 6.2.2 or older? Because Hidden Rows back then was only in the Pro package. It you are on any version above that (where v13.0.0 is the recent one) this should work for you.

No, this is just a misunderstanding on my end. I am on v13.0.0, but I found documentation stating the HiddenRows may be behind the PRO package. I see now that that is not the case.

The issue is resolved, thank you for your assistance.

I’m glad that it works for you now.

ps. we have col_left and col_right. But yes, I totally agree that col might not be the best pick.