Yii2在GridView分页中禁用pjax

Yii2在GridView分页中禁用pjax,gridview,pagination,yii2,pager,Gridview,Pagination,Yii2,Pager,如何为gridview的分页部分禁用pjax?除了分页之外,其他一切都可以使用pjax。可能吗 这样做的原因是因为我想在更改页面时发送帖子数据的分配。会话不是一个选项 我的网格视图: echo GridView::widget ([ 'id' => 'list_of_products', 'dataProvider' => $products, 'filterModel' => $productProvider,

如何为gridview的分页部分禁用pjax?除了分页之外,其他一切都可以使用pjax。可能吗

这样做的原因是因为我想在更改页面时发送帖子数据的分配。会话不是一个选项

我的网格视图:

    echo GridView::widget
    ([
        'id' => 'list_of_products',
        'dataProvider' => $products,
        'filterModel' => $productProvider,
        'filterSelector' => 'select[name="per-page"]',
        'summary' => '<div class="summary">Showing <b>' . $products->getTotalCount() . '</b> products</div>',
        'columns' =>
            [
                ....
            ],
        'pjax' => true,
        'responsive' => true,
        'responsiveWrap' => false,
        'pjaxSettings' => ['options' => [
            'id' => 'kv-pjax-container',
            'enablePushState' => false,
            'options' => ['class' => 'row col-lg-6']
        ]],
        'panel' => [
            'heading' => '<h3 class="panel-title"> Search result</h3>',
            'headingOptions' => ['class' => 'panel-heading product-container'],
            'beforeOptions' => ['class' => 'kv-panel-before'],
        ],
        'export' => [
            'label' => 'Page',
            'fontAwesome' => true,
        ],
        'toolbar' => [
            ['content' =>
                ''
            ],
        ],
        'toolbar' => [
            '<div class="form-group pull-right">
                <button onclick="addToList()" type="button" id="clear-filters" class="btn btn-primary">
                    <i class="fa fa-mail-forward"></i> Add to feed
                </button>
            </div>'
        ]
    ]);
}
?>
echo GridView::widget ([ 'id'=>'产品列表', “数据提供商”=>$products, “filterModel”=>$productProvider, 'filterSelector'=>'选择[name=“每页”], '摘要'=>'显示'$products->getTotalCount()。'产品', “列”=> [ .... ], 'pjax'=>正确, “响应性”=>正确, “responsiveWrap'=>错误, 'pjaxSettings'=>[ 'id'=>'kv pjax容器', “enablePushState”=>false, “选项”=>[“类”=>“行col-lg-6'] ]], “面板”=>[ '标题'=>'搜索结果', “标题选项”=>[“类别”=>“面板标题产品容器”], “beforeOptions”=>, ], “导出”=>[ “标签”=>“页面”, “fontAwesome”=>正确, ], “工具栏”=>[ ['content'=> '' ], ], “工具栏”=>[ ' 加入饲料 ' ] ]); } ?>
您可以通过将数据pjax=“0”属性添加到此链接来禁用容器内特定链接的pjax

在您的网格中,只需设置选项“寻呼机”:

echo GridView::widget
([
    'id' => 'list_of_products',
    ...
    'pager' => [
        'linkOptions'=> ['data-pjax' => '0']
    ],
]);
文件: