Big Problem When Using Clistview Inside Cjuitabs With Pagination

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 :blink: )

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 !!!

Because CListView in tabs content have same id ‘cat-view’

Try fix bug id duplicate


'id'=>'cat-view-'.$int,

Comment all your js code relative to tab and listview.

Then for me known you see second problem again?.

Thanks oxigen. now, pagination work fine.

but still get problem is: the Tab is lost.

When page is complete loaded, it’s look like:

http : // i.imgur.com/Qk70g.png (home.png)

But after that, i click on Android (or Windows Phone) tabs, it’s look like:

http : // i.imgur.com/cmcL6.png (tab_is_lost.png)

What wrong in this case ???

can you help me ?

I’d suggest using Firebug to make sure you’re closing your divs correctly and aren’t duplicating ids anywhere. I had a problem where I had tons of nested renderPartials in my tabs causing similar problems and it was a while before I found which was causing the problem.