How to hide context menu?

I have multiple sheets where ,

on sheet1 i want to show context menu add, edit, delete.
On sheet2 I want to show context menu insert, format.
On sheet3 I do not want to show any context menu .

Can you please help me for any work around?

Hello @priyab,

Can you please help me for any work around?

When it comes to the context menu customization, it is possible to change its structure completely with the help of the onBeforeShow event. For example, you can provide a new set of menu options, or not show it all in the first place.

On sheet1 I want to show context menu add, edit, delete.
On sheet2 I want to show context menu insert, format.

Could you please specify the intended functionality of the mentioned options?

I’m assuming that you are talking about a custom context menu, with custom actions binded to these options? If that’s the case, then you can achieve this by using the parse() method of the context menu to pass in a new set of options. There are a few ways that could help you attach the custom functionality to the menu options, but the best way would be to use the onCommand event handler and provide custom functions for appropriate items.

On sheet3 I do not want to show any context menu .

This is also possible to achieve inside of the onBeforeShow event simply by returning false (likewise, returning false in most of the onBefore... event handlers will prevent the related action).

Please take a look at the end result: https://snippet.webix.com/yqkzlbwt. As you can see, I’ve attached some custom functionality based on the options name as an example. I’ve also included a way to check for the sheet index instead of checking its id (since that can be changed, and isn’t a reliable/convenient way to implement a check in the first place).