mw.widgets.SelectWithInputWidget(configopt)

mw.widgets.SelectWithInputWidget

Example

mw.loader.using( 'mediawiki.widgets.SelectWithInputWidget', function () {
  var swi = new mw.widgets.SelectWithInputWidget( {
    or: true,
    dropdowninput: {
      options: [
        { data: 'other', label: 'Other' },
        { data: 'a', label: 'First' },
        { data: 'b', label: 'Second' },
        { data: 'c', label: 'Third' }
      ]
    },
    textinput: {
    }
  } );

  $( document.body ).append( swi.$element );
} );

Constructor

new mw.widgets.SelectWithInputWidget(configopt) #

Select with input widget. Displays an OO.ui.TextInputWidget along with an OO.ui.DropdownInputWidget. TODO Explain the OTHER option

Parameters:

Name Type Attributes Description
config Object <optional>

Configuration options

Properties
Name Type Attributes Default Description
dropdowninput Object <optional>

Config for the dropdown

textinput Object <optional>

Config for the text input

or boolean <optional>
false

Config for whether the widget is dropdown AND input or dropdown OR input

required boolean <optional>
false

Config for whether input is required

Source:
Select with input widget.

Extends

Methods

getValue() → {string} #

Get the value from outside.

Source:

Returns:

Type
string
Get the value from outside.

setValue(value) #

Set the value from outside.

Parameters:

Name Type Description
value string | undefined
Source:
Set the value from outside.