Introduction

The AddSelect Plugin gives you a possibility to select multiple values and save in a connection table. To access the plugin you will need to insert following script:

<script src="https://dokume.net/platform/js/class/addSelect.js"></script>

Create Dom element

Use this shorthand functions to write less code. Also it catches any errors if an element is undefiened.

    const addselect = new DokuMe_AddSelect('#parentSelector', [{
        ID: 1
        NAME: 'option title'
    }], function(instanceId) {
        backend.deleteObject(objectId, instanceId, false);
    });

    addselect.createUI();

Get selected values

This function will return an array with values from option element: ["12", "11"]

    addselect.getSelectedValues()

Edit selected values

    addselect.setSelectedValues(instanceId, optionId);