[]
        
(Showing Draft Content)

Add Context Menu Item

Follow the below steps to add the 'Insert Signature' option in the context menu component.

  1. 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;
  2. 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");
            }   
        }
    }
  3. 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: