Pasman
(Pasman P)
1
hi.
I use dropDownList field in ActiveForm, and get its options
from db:
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'color')->dropDownList(ArrayHelper::map(Color::find()->all(),'name','name') ) ?>
But what I need, is to get from db only part of options,
based on the prefix written manually in this field.
Which widget has this feature ?
Hi,
i think you mean to add where to find function:
Color::find()->where(['field' => $value])->all()
I don’t know if that what you mean or no.
Pasman
(Pasman P)
3
I want to search with prefix :
Color::find()->where(['like', ['field' => "$value%"])->all()
But the $value is in form not sent yet.
Maybe it is possible to add ajax code to send $value,
or other widget has this feature?
Pasman
(Pasman P)
4
I found that the jui\AutoComplete widget has this functionality.
Solved.