jQuery.each(result, function(index, value) { tmpString = '<div>' + '<label><input type="checkbox" name="Visits[checked_boxes][]" value="' + value.id + '"> ' + value.code + '</label>' + '</div>'; htmlList.push(tmpString); }); $('.boxList').html(htmlList.join("")) $('.field-visits-checked-boxes').show(); HoldOn.close(); }); } function clearBoxList() { $('.field-visits-checked-boxes').hide(); $('.boxList').html(); } </script> <?php View::endJs(); ?> <?php } else { ?> <p><?php echo Yii::t('app', "U heeft nog geen beschikbare projecten of projecten zonder kast.<br>Klik <a href='" . Url::toRoute('boxes/form') . "'>hier</a> om een nieuwe kast aan te maken of <a href='" . Url::toRoute('projects/form') . "'>hier</a> om een project aan te maken."); ?> </p> <?php } ?> </div>
?> <?php echo $form->field($model, 'blur')->dropDownList(Projects::getBlurOptions()); ?> <?php echo $form->field($model, 'embargo')->widget(DatePicker::className(), ['type' => 1, 'options' => ['placeholder' => Yii::t('app', 'Selecteer datum')], 'pluginOptions' => ['format' => 'dd-mm-yyyy', 'todayHighlight' => true, 'autoclose' => true, 'weekStart' => 1]]); ?> <?php echo $form->field($model, 'remarks')->widget(\yii\redactor\widgets\Redactor::className(), ['clientOptions' => ['buttons' => ['formatting', 'bold', 'italic', 'unorderedlist', 'orderedlist', 'outdent', 'indent', 'link', 'alignment', 'horizontalrule']]]); ?> </div> <div class="form-group"> <?php echo Html::submitButton(Yii::t('app', 'Opslaan'), ['class' => 'btn btn-primary pull-right']); ?> </div> <?php ActiveForm::end(); ?> </div> <?php echo View::beginJs(); ?> <script> /* CSS fix */ $('.select2-search__field').attr('style', 'width: 100%;'); </script> <?php echo View::endJs();