Hey! New user here. Thanks for helping. 
I’m trying to display a clistview of some flickr images of wildlife. Sometimes flickr can take a long time to respond so I’d like to load the results from Flickr via an ajax call. Here’s what I have.
Here’s the Ajax method in WildlifeController:
public function actionAjaxFlickr($title)
{
.....
$images = getFlickrImages($title);
.....
$dataProvider=new CArrayDataProvider($images, array(
'id'=>'flickr',
'pagination'=>array(
'pageSize'=>$pageSize,
),
));
echo $this->renderPartial('_ajaxFlickr',array('dataProvider' => $dataProvider));
}
In my main view (wildlife/display/TITLE):
<ul id='wildlifeFlickrGallery' class='gallery'>
<?php
Yii::app()->clientScript->registerScript(
"test",
"jQuery.ajax({
type: 'POST',
url: '".CController::createUrl('/wildlife/ajaxFlickr/' . $model->common_name)."',
success: function(html){
jQuery('#wildlifeFlickrGallery').html(html);
}
});
",
CClientScript::POS_READY
);
?>
</ul>
And here’s _ajaxFlickr:
<?php
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_flickr',
'ajaxUpdate'=>'wildlifeFlickrGallery',
'afterAjaxUpdate'=>'function(id, data){
$(".flickrPretty").attr("rel","prettyPhoto");
$("a[rel^=\'prettyPhoto\']").prettyPhoto({\'slideshow\':5000,\'autoplay_slideshow\':false,\'show_title\':false,\'theme\':\'facebook\'});
}',
'pager' => array(
'header' => '',
),
));
?>
When I load wildlife/display/TESTANIMAL the first set of flickr images display just fine, but the pagination is broken. The next link, for example, reads: "wildlife/ajaxflickr?title=TESTANIMAL&page=2"
and on clicking instead of updating #wildlifeFlickrGallery in the already-loaded page, it loads _ajaxFlickr in a new page and displays the second set of images.
The CSS styling on the pagination is also missing - probably because that view isn’t being rendered normally? Any ideas on how to get this working as I intend?
Thanks!
Tom