CListView Type Pagination

Hi guys

I am from classic asp 3.0 and ran into yii after reading rave reviews on php frameworks.

I notice that CListView does pagination, but it displays a record at a time on a row, is there any widget that displays say x by y records per row?

For example, if I set it at 12 records per page, it lists the 12 records: 1 record for 12 times, can it or any other zii widget list say 3 by 4 or 2 by 6 or x by y instead of 1 by 12 on a page? It should also handle remainder records which cannot fill all 12 records on a page eg. 2 x 5.

Thanks!

What I need is to display a pic on each record for say, voting purposes, there would be 12 pics (records) or 16 pics (records) per page, customizable to 4 x 3 or 4 x 4 or any feasible combination on a CListView component.

Thanks!

I tried this primitive non-object oriented approach, if someone could do better, please:

$itemGroupMax is used to store the sub grouping count to list more than 1 item on the same row on the CListView:




[b]CListView[/b]

/*insert*/

public $itemGroupMax = 2;

/*insert*/

	public function renderItems()

	{

		echo CHtml::openTag($this->itemsTagName,array('class'=>$this->itemsCssClass))."\n";

		$data=$this->dataProvider->getData();

		if(count($data)>0)

		{

			$owner=$this->getOwner();

			$render=$owner instanceof CController ? 'renderPartial' : 'render';

/*insert*/

$itemGroupCnt=0;

/*insert*/

			foreach($data as $i=>$item)

			{

/*insert*/

if($itemGroupCnt==0 || $itemGroupCnt==$this->itemGroupMax)

{

  echo "< div class='itemgroup' >";

  $itemGroupCnt=1;

}

else

{

  $itemGroupCnt++;

}

/*insert*/

				$data=$this->viewData;

				$data['index']=$i;

				$data['data']=$item;

				$data['widget']=$this;

				$owner->$render($this->itemView,$data);

/*insert*/

if($itemGroupCnt==$this->itemGroupMax || count($data)==$i+1)

{

  echo "< /div >";

}

/*insert*/

			}

		}

		else

			$this->renderEmptyText();

		echo CHtml::closeTag($this->itemsTagName);


	}