SelectField
SelectField (select)
This field allows you to display a list.
{
"size": "s12 m12",
"type": "select",
"id": "api_Finder",
"label": "API Finder",
"validate": [
"required"
],
"icon": "find_in_page",
"allow_add": false,
"search": true,
"search_error": "Brak pracowników pasujących do podanych kryteriów...",
"placeholder": "api finder placeholder",
"alphabetical_sorting": true,
"define_output_value": "label",
"add_session_id_to_api": true,
"api_dynamic": {
"delay": 250,
"api": "https://kprm.int.intalio.pl/otrs/get-all-users.pl",
"searching_label": "Trwa wyszukiwanie pracowników..."
},
"options": [
{
"value": "",
"label": "",
"selected": "true",
"disabled": "disabled"
}
]
},
Enabling this parameter will add new things to the list. If your list is not closed, you can let new things be added to it.
search
It allows you to search in the list, if it is enabled together with "allow_add" you will be able to search, or if you do not find an interesting option - add your own.
search_error
If the item you are looking for is not found, the message given here will be displayed.
alphabetical_sorting
Enable alphabetical sorting of fields. If this option is disabled, the fields are displayed in the order given in the "options" parameter.
define_output_value
Each field is described by two parameters "label" and "value". If you want to, you can define here whether you want the system to be "label" or "value".
options
All available selection options.
Remember, if you don't want the first option to be checked by default, you must add an empty first option!
value
Field value.
label
Field label.
checked
Should the field be selected by default.
disabled
Is the field to be inactive by default.
api_dynamic
Added in version 1.0.24
This field allows you to search the api dynamically.
This field supports all other api attributes (e.g. add_session_id_to_api)
Response:
{
"options": [
{
"value": "p.majewski",
"label": "Piotr Majewski (p.majewski)"
},
{
"value": "piotr",
"label": "Piotr Nowak (piotr)",
}
]
}
delay
The number of milliseconds to wait for the user to stop typing before issuing the ajax request.
api
The url that the request should be made to.
searching_label
Translation for the search text.
The rest of the available parameters:
This field supports all parameters with "Attributes available for each field".