Hi,
I have a CGridView that uses the PrettyPhoto widget on a link column (see screenshot). All works well on the 1st page, but after using ajaxlink to browse to 2nd page, PrettyPhoto stops working.
I’ve looked to see if there are duplicate Id’s that the JS would stumble on but can’t see any.
Anybody have a solution for this?
Thanks,
Matt
<h1>Manage Galleries</h1>
<?php $this->widget('NotificationWidget'); ?>
<?php
$pretty = $this->createWidget('prettyPhoto');
$options = array(
//'id' => 'pretty_photo',
'show_title' => false,
'overlay_gallery' => false,
'opacity' => 0.8,
'deeplinking' => false,
);
PrettyPhoto::addPretty('.link-column a', PrettyPhoto::PRETTY_SINGLE, PrettyPhoto::THEME_DEFAULT, $options);
?>
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'gallery-grid',
'dataProvider' => $model->search(),
'filter' => $model,
'columns' => array(
'filename',
array(
'class' => 'CLinkColumn',
'header' => 'Preview',
'urlExpression' => 'Yii::app()->createUrl(Yii::app()->params["uploadDirectory"] . $data->filename)',
'label' => 'Preview Image',
'linkHtmlOptions' => array(
//'class' => 'pretty_image',
),
),
array(
'class' => 'CButtonColumn',
'header' => 'Update',
'template' => '{update}',
),
array(
'class' => 'CButtonColumn',
'header' => 'Delete',
'template' => '{delete}',
),
),
)); ?>