B
B
BATPYIIIKOB2018-04-06 12:58:52
Yii
BATPYIIIKOB, 2018-04-06 12:58:52

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.
5ac7437800442758991610.jpeg
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
5ac743e4d3895384786410.jpeg
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

1 answer(s)
B
BATPYIIIKOB, 2018-04-06
@BATPYIIIKOB

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 question

Ask a Question

731 491 924 answers to any question