Answer the question
In order to leave comments, you need to log in
Why is the toggle switch in Yii2 kartik-v\GridView not working?
Good afternoon.
The kartik-v\GridView widget for Yii2 contains the functionality of switching between viewing all data and paginated data.
as you can see in the figure, there are 28 entries in total, 20 are displayed.
When you click on the button, all 28 should be displayed, but:
../index.php?r=product%2Findex&_tog1149016d=all
the same page data is displayed.
../index.php?r=product%2Findex&_tog1149016d=page
How can I solve the problem?
And where are the parameters passed in the request processed?
Answer the question
In order to leave comments, you need to log in
Found a solution! It turns out there was a conflict.
Everything worked successfully when 'filterModel'=>$searchModel was added to the very bottom of the widget settings.
<?= GridView::widget([
'dataProvider'=>$dataProvider,
'rowOptions' => ['style' => 'background-color:white;'],
'pjax'=>true,
'responsive'=>true,
'panel'=>['type'=>'primary'],
'columns' => $dataColumns,
'toolbar' => [
'{export}',
'{toggleData}'
],
'exportConfig' => [
GridView::EXCEL => ['label' => 'Сохранить в файл EXCEL'],
],
'filterModel'=>$searchModel,
]); ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question