How to prevent row delete or insert in spreadsheet?

Dear Developer,

May I know, Is there a possible way to prevent row delete or insert in a spreadsheet?
I am using like this:
onRowOperation:(id) => {
if(id == "del" || id == "add"){
return false;
}
}

It is now working.

Thanks

Tagged:

Comments

  • edited June 9

    Hello @NaingOo ,
    In such case, you can redefine the context menu itself via the onContextMenuConfig event handler and catch the "onCommand" event of the Spreadsheet widget and assign custom functions to every command . The event is used by Spreadsheet inner logic as well, so you have to check the id of the command, which should correspond to menu item id.
    Here's the snippet: https://snippet.webix.com/nlziai7n

    As alternative solution, you can access Spreadsheet's context menu via its inner id ($$("context")) and disable/remove items that are present within it:

    Using disableItem to make certain items unclickable (disabled): https://snippet.webix.com/cobbiioq;
    Removing items altogether via the remove() method: https://snippet.webix.com/x7jnlyhr;

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion