Constructor
new TreeSelect()
A highly configurable select control
- Since
- 1.9.0
- Copyright
- schukai GmbH
import {TreeSelect} from '@schukai/component-form/source/tree-select.mjs';
const treeSelect = document.createElement('monster-tree-select');
treeSelect.setOption('mapping.valueTemplate', '${name} (${alpha-2})')
treeSelect.setOption('mapping.labelTemplate', '${country-code}')
treeSelect.importOptions([
{
"name": "United Kingdom",
"alpha-2": "GB",
"country-code": "826",
"parent": undefined
},
{
"name": "Sweden",
"alpha-2": "SE",
"country-code": "752",
"parent": undefined
},
{
"name": "Germany",
"alpha-2": "DE",
"country-code": "276",
"parent": undefined
}
]);
document.body.appendChild(treeSelect);
Members
defaults
data-monster-options
must be used.To set the options via the html tag the attribute data-monster-options
must be used.
Name | Type | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mapping.rootReferences | String | ['0', | undefined, null] | ||||||||
mapping.idTemplate | String | id | |||||||||
mapping.parentTemplate | String | parent | |||||||||
mapping.selection | String | ||||||||||
formatter | Object | Properties
|
- See
- https://monsterjs.org/en/doc/#configurate-a-monster-control The individual configuration values can be found in the table.
(static) instanceSymbol
instanceof
operator.This method is called by the instanceof
operator.
- Since
- 2.1.0
Methods
assembleMethodSymbol() → {Monster.Components.Form.Select}
importOptions(data) → {Select}
Import Select Options from dataset Not to be confused with the control defaults/options
.Import Select Options from dataset Not to be confused with the control defaults/options
Name | Type | Description |
---|---|---|
data | array | |
- Since
- 0.16.0
map is not iterable
- Type
- Error
- Type:
- Select
(static) getCSSStyleSheet() → {Array.<CSSStyleSheet>}
- Type:
- Array.<CSSStyleSheet>
(static) getTag() → {string}
- Type:
- string