Initializes and returns a segmented button instance configured with the specified options.
DOM element associated with the view.
Data used when rendering the view, if any.
Button identifier.
Returns the button metadata, including identifier, key, current value, and selected segments.
Returns whether the button is currently expanded.
Returns whether the segments are configured as filter options.
Custom data associated with the button, if any.
Configuration options.
A Boolean indicated whether the button is currently selected.
Current component state.
Title label displayed for the button.
Interface DOM targets, which are only available after the view has been rendered to the DOM.
Value associated with the currently selected segment(s).
Value associated with the currently selected segment(s).
Adds the view's element to the DOM by appending it to the specified target.
DOM target in which the view will be appended
Returns true
if the button contains a segment option associated with the specified
value. This can either be a button segment value or identifier.
Deselects the button.
Deselects the button segment associated with the specified option.
Enables or disables the button. If disabled, button will not react to click events.
Returns whether the listeners are registered for the specified event name.
Hides the view.
Updates the view's position to the specified x and y values with optional offsets. The view must be configured with absolute positioning.
Removes a registered listener function for the specified event.
Name of the event to remove the listener for.
Handler function to remove so it won't be executed next time the event is triggered.
Registers a listener function to be executed each time an event occurs
Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.
Handler function to be called when the event occurs
Registers a listener function to be executed the first time an event occurs.
Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.
Handler function to be called when the event occurs
Parent DOM target, if any. Parent will be null
if the view has not been added to the DOM.
Positions the view by pinning it relative to its parent container. The view must be configured with absolute positioning.
Anchor position of the view within its container
Removes the view from the DOM.
Returns the button segment groups associated with the button.
Returns an array of identifiers from the button segments.
Returns an array of values from the button segments.
Returns an array of child button segment for the button.
Selects the button.
Selects the button segment associated with the specified option. If select
is true
, then
then parent button will also be selected.
Returns the selected button segment(s).
Updates the component state with the provided properties. Only those state properties provided will be updated, while all other state properties will retain their existing values.
Assigns the UI targets according to the view's configured interface selectors.
Note that this method should only be called after the view has been rendered and added to the DOM.
Shows the view.
Triggers the specified event so that all registered listeners will be executed with the specified parameters.
Event name to trigger
Generated using TypeDoc
A
SegmentedButton
is a button subclass that also contains a segmented control within the button, which can be used to change the current value of the button or to use as a secondary value associated with the button's value, such as filters.