InputAutoComplete

Input component for selecting items from a list of options, with support for load options for ajax request and searchs through a field with instantly requests to backend using the inputed parameters.

Component properties

optionsUrl String

URL address that returns the select’s options.

default: undefined

options Array

Static list of select’s options. Each list element is an object with name and value properties that, respectively, referes to the name and value of select’s options.

default: []
Example
<InputAutocomplete
    options={[
        { name: 'foo', id: 'foo' },
        { name: 'bar', id: 'bar' }
    ]}
/>

requestTimeout Number

Duration of a request.

default: 300

nameField String

Object’s property name received from backend which contains the option name.

default: 'name'

valueField String

Object’s property name received from backend which contains the option value.

default: 'id'

multiple Boolean

In case of true, enables multiples selections.

default: false

maxOptions Number

Max quantity to be retrieved by the backend.

default: 99

maxOptionsParam String

Query string parameter name sended to backend with max quantity to be retrieved.

default: 'limit'

searchParam String

Query string parameter name sended to backend with the search parameter.

default: 'query'

actionButtons Array

Object used to define buttons in the InputAutocompleteResult. As can be seen in the example above, according to the properties, a button is mounted inside the InputAutocomplete select.

default: []

dependsOn Object

Object defining the input on which this select is dependent.

dependableId String

DOM element id for the dependent input.

param String

Parameter to be sent to the server to request the options.

default: null

Callback functions

onLoad Function

Callback function that runs when the select's options are loaded.

default: null

onLoadError Function

Callback function that is called if there is an error when the options are loaded.

default: null

onSelect Function

Callback function executed when an option on select is selected.

default: null