Hi,
i am using extension from kartik DatePicker and Select2. The problem is when user want to choose data from select2, widget datepicker also open (dropdown) too.
I don’t know what’s wrong. Please advice. thanks before.
here is my simple code.
<?php
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\date\DatePicker;
/* @var $this yii\web\View */
/* @var $model app\models\Panjar */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="panjar-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'dp_date')->widget(DatePicker::class,
[
'type' => DatePicker::TYPE_COMPONENT_APPEND,
'value' => date('Y-m-d'),
'pluginOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd'
]
]) ?>
<?= $form->field($model, 'agen_id')->widget(kartik\select2\Select2::class, [
'data' => ArrayHelper::map(\app\models\Agen::findAll(['listed' => true]), 'id', 'name'),
'options' => ['placeholder' => 'Select Agen'],
'pluginOptions' => [
'allowClear' => true,
],
]
) ?>
<?= $form->field($model, 'total')->widget(\yii\widgets\MaskedInput::class,
[
'clientOptions' => [
'alias' => 'numeric',
'groupSeparator' => ',',
'digits' => 0,
'autoGroup' => true,
'removeMaskOnSubmit' => true,
'rightAlign' => false,
]
]) ?>
<?= $form->field($model, 'remark')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'transfer')->checkbox() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>