SpreadJS 14
SpreadJS Designer Component / Customizations / Add Context Menu Item
In This Topic
    Add Context Menu Item
    In This Topic

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

    1. Open and edit the config.js file to add the "Insert Signature" option in "contextMenu" tag.
      JavaScript
      Copy Code
      var config = {
          // other items contents
          "contextMenu":[
                  
                 "designer.insertSignature",
                  // other context menu items
      
                  ],
          ...
          }
      

    2. Set the command to commandMap in your project.
      JavaScript
      Copy Code
      config.commandMap = {
                      "designer.insertSignature": {
                          text: "Insert Signature",
                          commandName: "designer.insertSignature",
                          visibleContext: "ClickRowHeader",
                          execute:
                          // execute_InsertSignature, following just a simple demo code snippet
                          () =>{
                              console.log("Insert Signature");
                          }
                      }
                  }
      

    3. Initialize the designer instance by passing "config" parameter for customizable configuration.
      JavaScript
      Copy Code
      // Initialize the designer instance
      var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
      var designer = new GC.Spread.Sheets.Designer.Designer(document.getElementById("gc-designer-container"), config, spread);
      

       The below output will be generated: