Hi everyone,
I have a little problem: i’using CListView with infiniteScroll extension to show some photos.
This is the controller
public function actionIndex()
{
$criteria=new CDbCriteria(array(
'order'=>'id DESC',
'condition'=>'published='.Photos::STATUS_PUBLISHED,
));
$dataProvider=new CActiveDataProvider('Photos', array(
'criteria'=>$criteria,
'pagination'=>array(
'pageSize'=>5,
),
));
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
This is the view
$this->widget('zii.widgets.CListView', array(
'id' => 'photos-list',
'dataProvider' => $dataProvider,
'itemView' => '_view',
'template' => '{items} {pager}',
'pager' => array(
'class' => 'ext.infiniteScroll.IasPager',
'rowSelector'=>'.photo',
'listViewId' => 'photos-list',
'header' => '',
'loaderText'=>'Loading...',
'options' => array('history' => false, 'triggerPageTreshold' => 10, 'trigger'=>'More...'),
)
)
);
I’m in trouble becouse I would to display photos like this
|xxxxxxx| |xxxxxxx| |xxxxxxx|
|xxxxxxx| |xxxxxxx| |xxxxxxx|
|xxxxxxx| |xxxxxxx| |xxxxxxx|
|xxxxxxx| |xxxxxxx| |xxxxxxx|
|xxxxxxx| |-button| |xxxxxxx|
|xxxxxxx| |xxxxxxx| |xxxxxxx|
6 photos per page, but the 5th element isn’t a photo, but a button.
Any suggestions?
Thanks a lot!