T
T
Tatiana Komarova2015-09-15 15:10:02
Yii
Tatiana Komarova, 2015-09-15 15:10:02

Why doesn't DateRangePicker (kartik-v) YII2 work?

I installed the extension via composer. I display the widget in view:

<?php
echo '<label class="control-label">Date Range</label>';
echo '<div class="drp-container">';
echo DateRangePicker::widget([
    'name'=>'date_range_2',
    'presetDropdown'=>true,
    'hideInput'=>true
]);
echo '</div>';
?>

The widget is displayed, but when you click on it, nothing happens. The console does not give any errors.
What could be the problem? As I understand it, neither
CSS nor JS files were loaded ... how to fix it? When using the usual render, everything worked.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimon, 2015-09-15
@tatia_kom

"As I understand it, neither CSS nor JS files were loaded..." how did you understand this? I look at the "Network" tab in the browser console, and there is a javaScript filter. and if something is not loaded, you can see it there.
Most likely you just have two identical $model->date_range_2 fields on the page, one is in the search form in: <?php echo $this->render('_search', ['model' => $searchModel]); ?> and the other one you specified.
And the calendar is hung on the first.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question