mw.widgets.UserInputWidget

User input widget.

Extends

Constructor

new mw.widgets.UserInputWidget(config) #

Create a mw.widgets.UserInputWidget object.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
limit number optional
10

Number of results to show

api mw.Api optional

API object to use, creates a default mw.Api instance if not specified

Mixes in:
Source:

Methods

getLookupCacheDataFromResponse(response) → {Object} #

Get lookup cache item from server response data.

Parameters:

Name Type Description
response any

Response from server

Source:

Returns:

Type
Object
Get lookup cache item from server response data.

getLookupMenuOptionsFromData(data) → {Array.<OO.ui.MenuOptionWidget>} #

Get list of menu items from a server response.

Parameters:

Name Type Description
data Object

Query result

Source:

Returns:

Menu items

Type
Array.<OO.ui.MenuOptionWidget>
Get list of menu items from a server response.

onLookupMenuChoose(item) #

Handle menu item 'choose' event, updating the text input value to the value of the clicked item.

Parameters:

Name Type Description
item OO.ui.MenuOptionWidget

Selected item

Source:
Handle menu item 'choose' event, updating the text input value to the value of the clicked item.