furo-ui5-segmented-button #
@furo/ui5 v1.18.0
import '@furo/ui5/src/furo-ui5-segmented-button.js';
exports FuroUi5SegmentedButton js
mixes FieldNodeAdapter
Summary: segmented button
Description #
The furo-ui5-segmented-button component represents a drop-down list. The items inside define the available options by using the furo-ui5-segmented-button component.
|
|
Example with options from specs #
A simple way to use the segmented button is, uising it with specified options for a string type.
Defining a type with the options may look like a big overhead, but it let you switch the UI implementation by just changing the tag name.
The labels in the demo are not translated for better readability.
Markup #
|
|
Type definition #
look at
fields.sex.meta.options.list
|
|
Example with bindOptions #
Markup #
|
|
Attributes and Properties #
activeFieldBinding #
default: false
Flag to indicate if a field is attached
Default: false
idFieldPath #
default: 'id'
Defines the field path that is used from the bound RepeaterNode (bindOptions()
) to identify the option items.
Point-separated path to the field
E.g. data.partner.ulid
default: id
displayFieldPath #
default: 'display_name'
Defines the field path that is used from the bound RepeaterNode (bindOptions()
) to display the option items.
Point-separated path to the field
E.g. data.partner.display_name
default: display_name
valueFieldPath #
default: 'id'
Defines the field path that is used to update the bound component if the user has selected an option.
Point-separated path to the field
Must be set if a data binding is specified.
default: id
Events #
options-updated #
at-options-updated
→ optionNodeList
Fired after the option list was rebuilt
furo-value-changed #
at-furo-value-changed
→ {*} the value from the value-field. By default the value field is "id"
Fired when value has changed from the component inside. bubbles
item-selected #
at-item-selected
→ selectedOption
Fired when the toggle button was clicked. Payload: - if no option binding is active: ui5-segmented-button-item - if a RepeaterNode is bound: FieldNode
Methods #
bindData #
bindData(fieldNode `` ) ⟹ boolean
`` → fn-bind-data
Binds a FieldNode to the component.
Supported types:
- fieldNode
bindOptions #
bindOptions(repeaterNode RepeaterNode
) ⟹ void
RepeaterNode
→
fn-bind-options
Bind a RepeaterNode
that will be used to build up the option list.
Use idFieldPath
and displayFieldPath
if your structrure does not match the following signature:
|
|
- repeaterNode The list with the options
readAttributes #
readAttributes() ⟹ void
*
→
fn-read-attributes
Reads the attributes which are set on the component dom.
those attributes can be set. readonly
,disabled
, value-field-path
, display-field-path
Use this after manual or scripted update of the attributes.
selectOptionById #
selectOptionById(val Id
) ⟹ void
Id
→
fn-select-option-by-id
Selects an option by id
- val The id