M
M
Messi2018-04-04 08:32:03
Yii
Messi, 2018-04-04 08:32:03

Link not working after pjax?

Hello!
The page has a GridView wrapped in pjax with filters.
A link has been added to each entry:

<?= GridView::widget([
            'dataProvider' => $dataProvider,
            'rowOptions' => function ($model, $key, $index, $grid) {
                return [
                    'data-pjax' => 0,
                    'data-method' => 'post',
                    'data-url' => Url::to(['test', 'result_id' => $model->id]),
                ];
            },

But, the link only works if you do not use Pjax, if the filter or pagination worked without reloading, then the link remains on each post, but it is not clickable. Why is this and how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-04-04
@webinar

With 'data-method' => 'post' js is generated that intercepts the click. Try get, since post is clearly not a link.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question