Clistview Ajax Content

Hi all,

Here what I try to do:

I have tab menu - Tab1 and Tab2. When one of them is clicked with ajax I load it’s specific content. I use CListView to display this content. It works fine but when I try to use pagination things are mess up.

When Tab is clicked I call this function:




    public function actionAjaxrender($id){

            $criteria = new CDbCriteria;

            $criteria->condition = 'cat_id=:id';

            $criteria->params = array(':id'=>$id);

            $dataProvider = new CActiveDataProvider('Game', array(

                'criteria'=>$criteria,

                'pagination' => array(

                    'pageSize'=>2

                ),

            ));

            $this->renderPartial('categories', array('dataProvider'=>$dataProvider));

    } 



And in categories.php:




    $this->widget('zii.widgets.CListView', array(

        'dataProvider'=>$dataProvider,

        'itemView'=>'_view',

    ));



And when I select some page from pagination result is only data from _view file. No styles, no header, footer…

I think I understand what is happening but I can’t fix it.

How can be loaded content throw ajax with pagination?

If someone can help me I will be very grateful.

Thanks.

please refer to this topic : lazyLoad CGridView

it is suitable both for CGridView and CListView . then you click a tab menu you can lazyLoad the view content by ajax requesting . i haven’t tested it but it should work . :D