CGridView Filter duplicate Ajax requests when using Tabs

前提是你 提交于 2019-12-02 15:56:08

问题


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 GET requests if type the search value once.

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.

来源:https://stackoverflow.com/questions/30071419/cgridview-filter-duplicate-ajax-requests-when-using-tabs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!