Clistview Ajax Pagination

Hi all,

I’m working on a sort of activity feed with items provided by a CListView widget. The declaration for that is here:


<?php

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

	'dataProvider'=>$dataProvider,

	'itemView'=>'_viewEvent', 

        'id'=>'activity-feed',

        'pager' => array(

                    'class' => 'ext.infiniteScroll.IasPager', 

                    'rowSelector'=>'.view.top-level', 

                    'listViewId' => 'activity-feed', 

                    'header' => '',

                    'options'=>array('onRenderComplete'=>'js:function () {

                        $.each($(".list-view"), function(){

                            if(typeof $.fn.yiiListView.settings["\'"+$(this).attr("id")+"\'"]=="undefined")

                                $(this).yiiListView();

                        });

                    }'),

                  ),

	'baseScriptUrl'=>Yii::app()->request->baseUrl.'/themes/'.Yii::app()->theme->name.'/css/listview',

	'template'=>'{pager} {items}',

)); ?>

I’m using an infinite scrolling pagination extension found here: http://www.yiiframework.com/extension/inifinite-scroll-pager/ (though if I disable this extension and just use default pagination the error happens as well). Each event on this feed has a comments section which has data provided by another CListView widget. Each _viewEvent being rendered by the initial list view has this block of code to initialize the comments list view widget:


<?php 

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

                'dataProvider'=>$commentDataProvider,

                'itemView'=>'../social/_view',

                'template'=>'&nbsp;{items}',

                'id'=>$data->id.'-comments',

            ));?>

The nested list view renders properly on the page but I am unable to do anything with it once it’s loaded. Attempting to call $.fn.yiiListView.update(id) does nothing. It used to return an error that the list view was undefined, which is why I added the onRenderComplete javascript to attempt to initialize all the new list views when the outer list view finishes pagination. The ajax request fires perfectly fine when I call update, but nothing happens when it returns and I don’t get any sort of error logged.

Any advice here would be much appreciated,

Jake