$this->setTypeField([
'field_name' => ['select', [CategoryModel::class, 'id', 'title']],
...
]);
Example:
$this->ajaxBeforeLoadSelect(function ($model, $request){
//return array
})
Example:
$this->ajaxBeforeLoadSelect()
->set('user_id')
->show(['first_name', 'second_name']);
method set($name_field)
The name of the field to be redefined.
method show($array)
The method takes an array of fields to be displayed one after the other in the “select” list.
method limit($count)
Determines the size of the list. The default is 10
method limit($count)
Determines the size of the list. The default is 10
method lastSearch()
The mask for the search field will be “search string %”
method firstSearch()
The mask for the search field will be “% search string”
Example:
$this->ajaxBeforeLoadSelect()
->set('user_id')
->show(['first_name', 'second_name'])
->limit(15)
->lastSearch()
->firstSearch();
// result
// "% search string %"