summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TRepeater/RegionDisplay.php
blob: 40d1841e6d3c9550ac72b7ba6dbcf160e6297c5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

class RegionDisplay extends TRepeaterItemRenderer
{
	/**
	 * This method is invoked when the data is being bound
	 * to the parent repeater.
	 * At this time, the <b>Data</b> is available which
	 * refers to the data row associated with the parent repeater item.
	 */
	public function onDataBinding($param)
	{
		parent::onDataBinding($param);
		$this->Repeater->DataSource=$this->Data['detail'];
		$this->Repeater->dataBind();
	}

	public function itemCreated($sender,$param)
	{
		static $itemIndex=0;
		$item=$param->Item;
		if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
			$item->Row->BackColor=$itemIndex%2 ? "#BFCFFF" : "#E6ECFF";
		$itemIndex++;
	}
}

?>