i have database include table: tbl_category
, tbl_store_product
, tbl_store_product_category
i using CJuiTabs with child tab is load from table tbl_category
,
and content of every tabs is load from CActiveDataProvider with relation:
tbl_category
1<---->M tbl_store_product_category
tbl_store_product
1<---->M tbl_store_product_category
tbl_category
M<---->M tbl_category
here is my Controller:
$model = Category::model()->findAllByAttributes(array('type'=>'store'));
$storeCategory = array();
foreach ($model as $key=>$value) {
array_push($storeCategory, $key = array(
'title'=>$model[$key]->name,
'content' => $this->renderPartial('cat_view_content',
array(
'dataProvider'=>$this->productBelongCategories($model[$key]->id),
'int' => $key),true,false
),
));
}
$this->render('index', array('storeCategory' => $storeCategory ,'storeProduct'=>$storeProduct));
In my View:
$this->widget('CTabView',array(
'tabs'=>$storeCategory,
'htmlOptions'=>array(
'style'=>'width:975px;',
)
));
In renderPartial cat_view_content:
$this->widget('zii.widgets.CListView', array(
'id'=>'cat-view',
'dataProvider'=>$dataProvider,
'template'=>'{items}{pager}',
'itemView'=>'product_view_content',
'summaryText'=>'',
'pager' => array(
'header' => '',
'maxButtonCount' => 5,
),
'itemsCssClass'=>'item-class',
'pagerCssClass'=>'pagerCssClass',
));
in itemView product_view_content:
<div style="background-color: gray;margin: 10px;">
<?php echo $data->product_name;?>
</div>
<br />
The first time load OK
(sorry, i can’t post image into this thread)
http : // i.imgur.com/eQ60g.png (home.png)
Then, i click page 2, problem is:
http : // i.imgur.com/3jKLN.png (click_on_page_2.png)
The data load is wrong (it’s load include data of Android’s category and Windows Phone’s category product )
And second problem: when click Android (or Windows Phone Tab): the Tabs is lost:
http : // i.imgur.com/ZmuYw.png (the_tab_is_lost.png)
Can every one help me fix this problem (when using pagination on CJuiTabs)?
Thanks all very much !!!