Yii2 Pjax Gridview Sort & Filter

I have been setting up a Pjax Gridview and I think I found a bug but looking for a possible workaround.

The problem is with Pjax sort links. Pjax is getting the link and doing everything correctly but it doesn’t pick up the filters. So in this scenario you can’t have a filter and be able to sort on this filter using Pjax.

In the model




        $systems = self::find();

        $sort = new Sort([

            'defaultOrder' => [

                'id' => SORT_DESC,

            ],

            'attributes' => [

                'id',

                'name',

            ],

        ]);


        $systems->andFilterWhere(['id' => $this->id]);

        $systems->andFilterWhere(['name' => $this->name])


        return new ActiveDataProvider([

            'query'      => $systems,

            'sort'       => $sort,

        ]);



In the view




<?php \yii\widgets\Pjax::begin([

  'timeout'       => false,

  'clientOptions' => [

    'replace' => false,

    'type'    => 'POST',

  ]

]);?>

<?= Html::csrfMetaTags() ?>

<?= GridView::widget([

  'dataProvider' => $systems,

  'filterModel'  => $system_model,

  'columns'      => [

    'id',

    'name',

  ],

]); ?>

<?php \yii\widgets\Pjax::end(); ?>



use "GET" Method instead of "POST".