[フレーム]
 []
 
MESCIUS Logo MESCIUS Logo
SpreadJS Logo
DEMOS DOC DESIGNER API
DOWNLOAD
(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.

    // 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("designerHost", config);

The below output will be generated:

image

AltStyle によって変換されたページ (->オリジナル) /