mercredi 6 mai 2015

CGridView Filter duplicate Ajax requests when using Tabs

In my web application I use tabs and load part of the views per Ajax. So it's possible, that I do load the same CGridView multiple times without reloading the page. If that occurs I become duplicate Ajax requests if I use CGridView Filters.

The filters and requests are standard. Following images show those simple filter and 10 x times GET requests if type the search value once.

simple filter duplicate ajax requests

Here is the code of Tabs-widget I use:

$this->widget('bootstrap.widgets.TbTabs', array(
'id' => 'thirdPartyCatTabs',
'title' => Translate::t('project', 'Categories'),
'type' => 'tabs',
'placement' => 'top',
'events' => array(
    'shown' => 'js:loadContent'
),
'tabs' => array(
    array(
        'id' => 'standardCat',
        'label' => Translate::t('project', 'Standard Categories'),
        'linkOptions' => array(
            'data-tab-url' => Yii::app()->createUrl('/thirdParty/settings/thirdPartyCategoryStandard'),
        ),
    ),
    array(
        'id' => 'standardCatMap',
        'label' => Translate::t('project', 'Standard Category-Mapping'),
        'linkOptions' => array(
            'data-tab-url' => Yii::app()->createUrl('/thirdParty/settings/showCategoryMapTab'),
        ),
    ),
)
));

I guess I have to use uniqid() at some place, but can't figure out where. Thanks.

Aucun commentaire:

Enregistrer un commentaire