Closed DrMabuse23 closed 10 years ago
As Autocomplete:
<?=
$form->field($model, 'countryName')->widget(Selectize::className(), [
'url' => Url::to(['country/list']),
'options' => [
'placeholder' => 'Enter country',
'class' => 'form-control',
],
'clientOptions' => [
'valueField' => 'value',
'labelField' => 'name',
'searchField' => 'name',
'create' => false,
'preload' => true,
'maxItems' => 1,
],
]) ?>
The url renders a JSON with the result of the search:
'[{"name":"yadayada","value":"3"}]'
thx
Hi Sorry how can i use it in an Form ? with model attribute ? with render ?
Thx