Hi, I want to create a new right-click menu option and then add the default option as a submenu, such as “row_above”, “row_below”, “col_left”, etc. Here is the code I write
`contextMenu:{
items: {
"edit_row_col": {
name: "operation",
submenu: {
items: [
{key: "row_above", name:"add a row above"},
{key: "row_below", name:"add a row below"},
{key: "col_left", name:"add a left col"},
{key: "col_right", name:"add a right col"},
]
}
}
}
}`
But when I click, the browser prompts “Error: Menu command ‘row_below’ not exists.”
I had a chat with our programmer and to be honest the documentation lacks some description for this method. I would personally remove this method from the official API as it cannot be called/used directly after making a call to the contextMenu plugin. However I will test it out a bit more.
In the meanwhile, as I suppose you need to use one or more options from this list. Can you share more details? All those options should be available by accessing correct plugins.
Sure. I want to put all the predefined commands that add rows/columns and delete rows/columns in the same submenu, but I didn’t achieve the effect when I clicked. What else details do you need? Here is the code
`contextMenu: {
items: {
"edit_row_col": {
name: "operation",
submenu: {
items: [
{key: "row_above", name:'add a row above'},
{key: "row_below", name:'add a row below'},
{key: "col_left", name:'add a left col'},
{key: "col_right", name:'add a right col'},
{key: "remove_row", name: 'delete row'},
{key: "remove_col", name: 'delete col'},
]
}
},
"hsep1": "---------",
"make_read_only": true,
"borders": true,
"mergeCells": true,
}
}`