Dropdown

Documentation

Input Parameters

Name Type Description  
className string The class name to apply to the main element.  
el HTMLElement The element to render the dropdown to.  
description string The drop down description.  
isUnsorted boolean Flag determining if the selected options are sorted alphabetically.  
multi boolean Allow multiple values.  
onChange (value: Array<IDropdownOption>) => void The change event  
options Array<IDropdownOption> The dropdown options.  
placeholder string The placeholder text.  
value _string Array<string>_ The dropdown value(s).

IDropdownOption Interface

| Name | Type | Description | | — | — | — | | isSelected | boolean | Flag determining if the option is selected | | options | Array<IDropdownOption> | The option children. | | text | string | The option text. | | value | any | The option value. |

IDropdown Interface

Name Type/Description
get() Returns the text element.
getFabricComponent() Returns the fabric component.
getValue() Returns the dropdown selected option(s).
setOptions(options: Array<IDropdownOption>) Updates the dropdown options.

JavaScript

var $REST = require("gd-sprest-js");

// Create the 
var el = document.querySelector("#");
$REST.JS.Fabric.({
    el: el,
});

TypeScript

import { Fabric } from "gd-sprest-js";

// Create the 
let el = document.querySelector("#");
Fabric.({
    el,
});