简体   繁体   中英

Yii Framework : CListView ajax pagination not working when used with CArrayDataProvider

I am using CArrayDataProvider to display listing of item in CListView.

Here is my dataProvider Widget :

$dataProviderSugPro=new CArrayDataProvider($suggested_products, array(
        'id'=>'suggested_products_list_data',
        'pagination'=>array(
            'pageSize'=>5,
        ),
    ));

and ClistView Widget :

$this->widget('zii.widgets.CListView', array(
        'dataProvider'=>$dataProviderSugPro,
        'id'=>'suggested_products_list',
        'enablePagination'=>true,
        'itemView'=>'t',
));

Everything works fine at first run but when I try to paginate using AJAX, the pagination is not working. There is no JavaScript or jQuery error as well in console.

Is there is problem when these widgets are used together?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM