[]
Follow the below steps to add the 'Insert Signature' option in the context menu component.
Access the default configuration.
// Configure Workbook and Worksheet
var spread = new GC.Spread.Sheets.Workbook("ss");
var activeSheet = spread.getActiveSheet();
// Access the default config
var config = GC.Spread.Sheets.Designer.DefaultConfig;
Add the "Insert Signature" option in the contextMenu
tag and set it into commandMap in your project.
// Add context menu item in config context menu
if (config && config.contextMenu) {
config.contextMenu.unshift("insertSignatureMenu");
}
// Create command for the new context menu item
config.commandMap = {
"insertSignatureMenu": {
text: "Insert Signature",
commandName: "insertSignatureMenu",
visibleContext: "ClickRowHeader",
// execute InsertSignature, following just a simple demo code snippet
execute: () => {
console.log("Insert Signature");
}
}
}
Initialize the designer instance by passing the config
parameter for customizable configuration.
// Initialize the designer instance
var designer = new GC.Spread.Sheets.Designer.Designer(document.getElementById("designerHost"), config, spread);
The below output will be generated: