Closed mtangoo closed 9 years ago
Sure!
can you give me an example? This one does not work properly (No list at all)
<?= $form->field($model, 'category')->widget(SelectizeDropDownList::className(), [
'value'=>['Stefano', 'Upendo', 'Hilkia', 'Moshe'],
]) ?>
Yep:
<?= $form->field($model, 'tags')->widget(SelectizeDropDownList::className(), [
'clientOptions' => [
// ...
],
);?>
The value should be the set on the $model->tags
attribute on this case (ie $model->tags =['love', 'this', 'game'];
)
it just does not work. I have checked print_r($model->tags);
and I get Array ( [0] => love [1] => this [2] => game )
but the Widget have nothing on it
I use
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'content')->widget(CKEditor::className(), [
'preset' => 'basic'
])
->label(false) ?>
<?= $form->field($model, 'tags')->widget(SelectizeDropDownList::className(), [
'clientOptions' => [
// ...
],
]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
It needs "items" attribute. Please update the docs to save others of my pain
<?= $form->field($model, 'category')->widget(SelectizeDropDownList::className(), [
'items'=>$model->tags,
'clientOptions' => [
// ...
],
]) ?>
Will do, thanks @mtangoo
Hi, thanks for nice sets of Widgets. Can this widget be used with form?