Methods
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.
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 |
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 |
val(val) | Returns the currently selected value set in the config's Optionally sets the currently selected value to |
validate | Validates the currently selected value using the rules set up in the config |
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
.
Last updated