ajax listing and shadowbox

making gallery, where is list view of photos (zii clist view + clinkpager), on them is shadowbox link. Problem is, when i click on next page/ page number, content reloads, but shadowbox stops working, works only on 1st page. so i think he needs some update on ajax reload. What is supposed to work is to force non-ajax listing, but dont know how to switch it just for the one listing :) or, update the shadowbox somehow…

tryed ajaxUpdate - false - no change, still on ajax,

tryed before/afterAjaxUpdate but the javascript fires only once when page on 1st listing page…




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

	'dataProvider'=>$dataProvider,

	'itemView'=>'_view',

	'afterAjaxUpdate'=>"Shadowbox.init({'language':'en','players':['img']})",

	'beforeAjaxUpdate'=>"Shadowbox.init({'language':'en','players':['img']})",

	

)); ?>




anybody had same problem? :)

try ‘afterAjaxUpdate’=>‘function() { Shadowbox.setup(); }’

add this to your controller before the render/renderpartial method;

Yii::app()->getClientScript()->registerScriptFile(Yii::app()->theme->baseUrl.’/js/shadowbox/shadowbox.js’); Yii::app()->getClientScript()->registerScript(“shadowbox-”.rand(0,10000),“Shadowbox.init();”);

that fixes the first page issue.

I am new on Yii, what I have to do for shadowbox works. Where do I put the widget?, where do I initialize it?, How to call It?

any help?

Read this to start off: http://www.yiiframework.com/doc/guide/

Generally though, put the widget into the view file, initialised and called as:


$this->beginWidget('WidgetClassName', array(any options go here...));

...

$this->endWidget();