Multiple separators in context menu?

Tags: #<Tag:0x00007efc6522dea0>

The answer to this question appears to be “no”, but since this seems like such a basic design oversight I thought I’d double check.

As far as I can tell from the docs, there’s two ways to set the items of the context menu: one is with an array of predefined items, and another is with an object. When using an array predefined items, it is of course possible to include the same key multiple times, however with this approach it’s not possible to use custom items, so it has very limited use.

When using the object approach, it is possible to use custom items – however, the items of the context menu are passed as properties of the object. Because of this, it’s not possible to use the same key twice, which means that only a single separator can be included in the context menu.

Is this use case really not supported by the API? It seems like such a basic and simple thing to handle, and considering how high quality and well designed most of this library is, I’m kind of shocked at how poorly thought out this particular feature is.

Anyways, thanks for taking the time to address this!

Hi @qubsoft

You are right. The documentation for this subject was not sufficient. We’ve made a small adjustment that waits to be released https://github.com/handsontable/docs/issues/15

Object approach

...
"sep1": '---------',
"sep2": '---------',
"sep3": '---------',
...

Please let me know if it works for you and if there’s anything else you’d like to be added to the documentation.

Hi @qubsoft

did that work for you?

@aleksandra_budnik Oops, sorry for the late response. Yup that worked. Thanks!

Great! Thank you for the update.
We can close this topic.