B
B
bagos2019-03-18 13:44:04
Yii
bagos, 2019-03-18 13:44:04

How to add to gridview Pjax data request->queryParams input value not from gridview?

The page displays a gridview. The gridview itself is wrapped in pjax.
Filtering by fields works, everything is correct, but I need to add one more input or checkbox to this filtering, which has nothing to do with the grid. Whenever filtering in request->queryParams, only grid fields arrive, how to add a left input there?

<?= Html::checkbox('test', true, ['label' => 'test', 'id' => 'test']) ?>
    <?php \yii\widgets\Pjax::begin([]); ?>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
...
<?php \yii\widgets\Pjax::end(); ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-03-18
@slo_nik

Good afternoon.
Add the desired variable to the model. Add required field to GridView

columns => [
     'input',
]

Also in the search model, add rules() to the rules and pass it to the request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question