Closed liamgcarter closed 5 years ago
Hiya Sorry. I found the issue. As i am using FormGrid the pluginOptions and htmlOption needs to nest in another options array like this
'field'=>[ 'type'=>Form::INPUT_WIDGET, 'widgetClass'=>DepDrop::classname(), 'options' => [ 'options'=> ['id' => 'field'], 'pluginOptions' => [ 'depends' => ['model'], 'placeholder' => 'select ...', 'url' => '/related-fields/dd-field' ], ], ],
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Many thanks for all your widgets they are amazing
I was wondering if you could help me
Here is my view part
'contentBefore'=>'<legend class="text-info"><small>Client Info</small></legend>', 'attributes'=>[ // 2 column layout 'model'=>['type'=>Form::INPUT_DROPDOWN_LIST, 'items'=>ArrayHelper::map(\app\models\Models::find()->All(), 'id','name'), 'options'=>['prompt'=>'Please Select..','id'=>'model']], 'field'=>[ 'type'=>Form::INPUT_WIDGET, 'widgetClass'=>DepDrop::classname(), 'options' => ['id'=>'field'], 'pluginOptions' => [ 'depends' => ['model'], 'placeholder' => 'select ...', 'url' => 'http://google.co.uk' ], ], 'related_value'=>['type'=>Form::INPUT_TEXT, 'options'=>['placeholder'=>'Enter Value...']],
And the error throw out this
_form.php at line 49 – yii\base\Widget::widget(['model' => app\models\RelatedFields, 'form' => kartik\form\ActiveForm, 'autoGenerateColumns' => true, 'rows' => [['contentBefore' => '
as you can see the value is there
'pluginOptions' => ['depends' => ['model'], 'placeholder' => 'select ...', 'url' => '/related-fields/dd-field']
Any ideas?