## Options
### Disable search
Add the `select-no-search` CSS class to disable searching.
## Option groups
Use the `optgroup` element to create option groups.
## AJAX search
Use the `data-handler` attribute to source the select options from an AJAX handler.
```html
```
The AJAX handler should return results as an array.
```php
public function onGetOptions()
{
$results = [
[
'id' => 1,
'text' => 'Foobar',
],
...
];
return ['result' => $results];
}
```
Due to the fact that JavaScript reorders numeric keys when interpreting the JSON data received by the AJAX handler, we suggest the method above for defining `results`. Support for the original `results` array format is however retained to ensure backwards compatibility.
```php
public function onGetOptions()
{
$results = [
'key' => 'value',
...
];
return ['result' => $results];
}
```