kartik-v/yii2-tabs-x

Issue with ajax link referring to page with tabx

m00nh3ck opened this issue · 1 comments

I noticed an issue when using kartik gridview with ajax enabled content.

Example:

 <?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
        'responsive'=>true,
    'hover'=>true,  
    'pjax'=>true,
    'pjaxSettings'=>[
        'neverTimeout'=>true
    ],   

A link referring to company info on the one of attributes

 return HTML::a(StringHelper::truncate($companyName, 40, $suffix = '...'),['customers/view','id' =>      $data->company_id],['title'=>$companyName]);

The company Page contain few tabs and once clicked on the company name link it should open a company page with all the tabs instead there seems be an ajax request and the page does not change instead of that a content of one TAB is displayed in the current view.

So basically a redirection to page does not happened instead of that ajax request happens and one of the tab content is displayed.

I had to disable ajax on the gridview.

Please let me know if any more info is needed.

The link on ajax enabled gridview works fine if they are referring to a different pages where tabs are not present.

the issue was observed when for example going from customer index to customer view.
i have fix this by adding id inside the pjaxSettings.

This fixed my problem so not sure if this bug any longer. Perhaps the generated pjax id were the same.

'pjaxSettings'=>[
~ 37 'neverTimeout'=>true,

  • 38 'refreshGrid' => true,
  • 39 'options' => [
  • 40 'id' => 'customer-index',
  • 41 ]
    42 ],