Hi, according to the docs:
You may disable pjax for a specific link inside the container by adding
data-pjax="0"
attribute to this link.
However, the “data-pjax” attribute is not being rendered by the Html::a helper for a simple link column in a GridView widget. This is my code:
<?php Pjax::begin(); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'attribute'=>'name',
'format'=>'html',
'value' => function ($data) {
return Html::a(Html::encode($data->name), ['view', 'id' => $data->id], ['data-pjax'=>0]);
},
],
],
]); ?>
<?php Pjax::end(); ?>
Am I missing something? If I change the third argument of Html::a to be:
['class'=>'abc']
It renders the attribute properly, so I’m lost as to why it’s not rendering the required custom attribute to disable pjax on that link. In fact, no custom html tags are being rendered. Any ideas will be appreciated. Thanks!