Methods
Last updated
Last updated
Select2 for WireBootstrap extends the wire.ui.component class. As such, it inherits all its base methods.
The following methods are added to Select2 for WireBootstrap.
The example below uses getSelectedItem
to get the currently selected data map value from a list of users in the drop down per the datamap
set up up in the configuration assuming jembiid
was selected.
The example below gets the data
row for the currently selected value in the same drop down using getSelectedRow
.
Name
Description
clear
Clears the current selection(s) and restores the list to its default state
dirty(val)
Returns whether there has been a change to the default selection. Optionally sets the dirty value to val
if supplied.
getSelectedItem
For single-select, returns the selected item from the config's data map
getSelectedItems
For multi-select, returns all the selected items from the data map
getSelectedRow
For single-select, returns the row from the config data
parameter in which the current selection resides.
val(val)
Returns the currently selected value set in the config's datamap.id.
This will be a single string or an array depending on whether select2.multiple
is set.
Optionally sets the currently selected value to val
if supplied.
validate
Validates the currently selected value using the rules set up in the config