<?= $form->field($model, 'template_id')->widget(CheckboxMultiple::className(), [
'dataAttribute' => 'template_id',
scriptOptions' => [450=>'abc',452=>'xyz'],
'placeholder' => Yii::t('app', 'Select ...'),
]) ?>
I try to implement this => https://github.com/diiimonn/yii2-widget-checkbox-multiple
but i am not getting the result. When I have done code I am getting blank page.
What is the mistake here ?
Are there any errors in js console? I think that problem seems to be with assets bundle of CheckboxMultiple widgets. There are missing depends property for JQuery Assets. Try to register jQuery manually before render widget.
dataAttributeproperty also seems to be unknown in latest version of this widget... This works for me:Where templates attribute is relation in model, like this:
and in SiteController action templates:
In this example I use table
templateswith columns:id,nameandowner_id. You should modify above script to yours names of models and attributes.