GH-Elements

Options Element

Option is a gh-element that allows user to select one of existed values from the drop-down list. If user has certain access, he can update the list as he wish.

Functional Characteristics

Due to the options, you create text fields that can be filled with only one of the drop-down list options. This element can be used for filling in the invoice or registration form.

Value Format

Each of the options has its own value, which is a sequential number obtained immediately after adding an option to the list.

{
    "field_value": "0"
}

Element Options

The options element contains two groups of settings. The first one configures the field while the second one configures its values.

Field Settings

These settings contains all standard and unique field options.

Settings of options field

Name Description
Multiple value allows to select a multiple value; detail...
Multiple selection allows to select one option multiple times; detail...

Multiple value

Like many gh elements, options has a function for selecting multiple values.

Multiple selection

This option allows to select the same option several times. Multiple selection is available only when multiple value is used.

Options Settings

This group of settings allows to configure options of each of values.

Settings of options

Name Description
Name column that contains names of the selection options; detail...
Edit column where delete and edit buttons are located; detail...

Name

The field for entering the name of the option which will be displayed in the element.

Edit

Edit contain two button for updating and deleting option.

Default Value Settings

These settings allows to configure default value of the options elements.

Settings of options default value

Name Description
Use default value allows to set whether default value is used or not
Default value allows to set own default value

Element Style

The options element has three groups of style settings. The first two groups are the standard one. About them you can read in Setting Overview. And the third one is a list of interpretations.

Style of options element

Data Model

The options element has a rather complex data model.

{
    "data_model":{
        "default_field_value": 0,
        "interpretation": [],
        "max_value": "1",
        "multiple_selection": 1,
        "multiple_value": false,
        "options": [{
            "name": "Out of Stock",
            "value": 0
        }],
        "use_default_value": false
    }
}
Name Type Description
default_field_value number shows which value is default
interpretation array contains all element interpretation types
max_value string contains the ID of the last value
multiple_selection boolean shows whether the multiple selection is used
multiple_value boolean shows whether the element accepts multiple values
options array contains all options from array of variants
name string contains name of the option
value number contains the unique ID of the value option in the element
use_default_value boolean shows whether the default value is used or not

Filtration

Interpretation

Types of options interpretation

Default

The default interpretation type of options element is an editable field that allows to choose on of set values. There are two ways to choose:

  • Select value in popup list
  • Enter value name in the field

Plain Text

This is interpretation with uneditable string of the selected value.

Value

The last interpretation type displays the selected value.