Get Started
Plugins
Macros
More information

Add custom fields

Description

Inserts custom fields into the document.

Plugin type: visual, non-system.

Supported editors: documents.

AddCustomFields
Installation

Download this plugin from GitHub and install it following the desktop, on-premises, or cloud installation instructions.

Usage
  1. Open the Plugins tab and press Example add custom fields.
  2. To add a simple field type your question and its label in the necessary fields and press the Add simple field button
  3. To add a drop down field type your question and its label in the necessary fields and add answer options. To add an answer option, type it in the Type your item field and press the Add button. Repeat it if you need more options. To remove any answer option, select it in the combo box and press the Remove button. When the field is ready, press the Add drop down field button.
  4. The field will be added in the current text cursor position.
Plugin structure

Repository on GitHub: https://github.com/ONLYOFFICE/sdkjs-plugins/tree/master/example_customfields_add.

  1. config.json, index.html and code.js
  2. Icons
Config
{
    "name" : "Example add custom fields",
    "guid" : "asc.{4E2B5030-E1BE-41FA-BEE3-7E9BE7B5BFCF}",

    "variations" : [
        {
            "description" : "Example add custom fields",
            "url"         : "index.html",

            "icons"           : ["icon.png", "icon@2x.png", "icon2.png", "icon2@2x.png"],
            "isViewer"        : false,
            "EditorsSupport"  : ["word"],

            "isVisual"        : true,
            "isModal"         : false,
            "isInsideMode"    : true,

            "initDataType"    : "none",
            "initData"        : "",

            "isUpdateOleOnResize" : false,

            "buttons"         : []
        }
    ]
}
Methods and events

The main plugin code is located here.

Support

If you want to request a feature or report a bug regarding this plugin, use the issues section on GitHub.