2017-05-19 6 views
0

GridView의 페이지 매김 부분에 대해 pjax를 어떻게 비활성화 할 수 있습니까? 다른 모든 것은 페이지 매김을 제외하고는 pjax로 작업 할 수 있습니다. 그게 가능하니?Yii2 GridView 페이지 매김에서 pjax 비활성화

이유는 페이지를 변경할 때 POST 데이터의 할당량을 보내려고하기 때문입니다. 세션은 옵션이 아닙니다.

내 GRIDVIEW는 :

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>' 
     ] 
    ]); 
} 
?> 

답변

0

이 링크에 데이터 pjax = "0"속성을 추가하여 용기 내부의 특정 링크에 대한 pjax을 해제 할 수 있습니다.

그리드에서

에게 단지 옵션을 설정합니다 '삐삐'

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

문서 : LinkPager

관련 문제