Context menu - dynamically - simple way

Hi,

is it possible to make snippet available, most of then does not work, error I get:

Cannot find module './view'.

Check console for more details
t is null

Check console for more details

Regards

Unfortunately, some really old snippets were lost during migration.
Which functionality are you insterested in?

i’m interested in the topic : how dynamically build menu entries - i do not find clear answer

I’m also interested in a working example on how to build a dynamic context menu for the Datatable. Almost all snippets from the thread are broken, except one, which I’m not going to link to, because it’s very hacky, modifying _private properties.

Is there a clean way to change the items of the context menu based on the data in the clicked row, for example setting a menu item text to “Show” vs “Hide” based on the state of a checkbox?

@dandv
check this
https://snippet.webix.com/452nbnai
basic logic is shown there.

Thank you for that comprehensive solution (header menu, row menu, empty area menu)!

Any idea why the menu doesn’t have an anchor, while this other approach does?

The other approach is the hacky solution I was referring to, and it has the bug of not clearing the menu before it’s created again (2+ consecutive right clicks). But it does have that highlighted anchor.

@dandv
looks like it is material/mini skin design.
as in other skins (your sample has flat skin) and in pre-6 versions anchor is shown by default.
in material/mini skin you can force it explicitly by setting point:true in contextmenu config.

Thanks for this.
Fixed the Second Appearance from the Menu !

https://snippet.webix.com/iwrbok7k