Class file: RegionDisplay.php
Template file: RegionDisplay.tpl
Template file: Sample1.page
Class file: Sample1.php
Template file: Sample2.page
Class file: Sample2.php
Template file: Sample3.page
Class file: Sample3.php
Template file: Sample4.page
Class file: Sample4.php
Template file: Sample5.page
Class file: Sample5.php

/Controls/Samples/TRepeater/RegionDisplay.php

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++;
    }
}
 
?>