From f7b1db61531f9309dc9a1b9587449442a7ae5ed5 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 30 Jan 2006 03:40:28 +0000 Subject: Added two repeater demos. --- .../pages/Controls/Samples/TRepeater/Sample1.page | 47 ++++++++++++++++++ .../pages/Controls/Samples/TRepeater/Sample1.php | 41 ++++++++++++++++ .../pages/Controls/Samples/TRepeater/Sample2.page | 55 +++++++++++++++++++++ .../pages/Controls/Samples/TRepeater/Sample2.php | 56 ++++++++++++++++++++++ 4 files changed, 199 insertions(+) create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.page create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.php create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample2.page create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample2.php (limited to 'demos/quickstart/protected/pages/Controls/Samples/TRepeater') diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.page b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.page new file mode 100644 index 00000000..8e469fde --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.page @@ -0,0 +1,47 @@ + + +

TRepeater Sample 1

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDNameQuantityPriceImported
<%#$this->Parent->DataItem['id']%><%#$this->Parent->DataItem['name']%><%#$this->Parent->DataItem['quantity']%><%#$this->Parent->DataItem['price']%><%#$this->Parent->DataItem['imported']?'Yes':'No'%>
<%#$this->Parent->DataItem['id']%><%#$this->Parent->DataItem['name']%><%#$this->Parent->DataItem['quantity']%><%#$this->Parent->DataItem['price']%><%#$this->Parent->DataItem['imported']?'Yes':'No'%>
Computer Parts Inventory
+ + +
+ +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.php b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.php new file mode 100644 index 00000000..c88b8d9a --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.php @@ -0,0 +1,41 @@ +'ITN001','name'=>'Motherboard','quantity'=>1,'price'=>100.00,'imported'=>true), + array('id'=>'ITN002','name'=>'CPU','quantity'=>1,'price'=>150.00,'imported'=>true), + array('id'=>'ITN003','name'=>'Harddrive','quantity'=>2,'price'=>80.00,'imported'=>true), + array('id'=>'ITN004','name'=>'Sound card','quantity'=>1,'price'=>40.00,'imported'=>false), + array('id'=>'ITN005','name'=>'Video card','quantity'=>1,'price'=>150.00,'imported'=>true), + array('id'=>'ITN006','name'=>'Keyboard','quantity'=>1,'price'=>20.00,'imported'=>false), + array('id'=>'ITN007','name'=>'Monitor','quantity'=>2,'price'=>300.00,'imported'=>true), + array('id'=>'ITN008','name'=>'CDRW drive','quantity'=>1,'price'=>40.00,'imported'=>true), + array('id'=>'ITN009','name'=>'Cooling fan','quantity'=>2,'price'=>10.00,'imported'=>false), + array('id'=>'ITN010','name'=>'Video camera','quantity'=>20,'price'=>30.00,'imported'=>true), + array('id'=>'ITN011','name'=>'Card reader','quantity'=>10,'price'=>24.00,'imported'=>true), + array('id'=>'ITN012','name'=>'Floppy drive','quantity'=>50,'price'=>12.00,'imported'=>false), + array('id'=>'ITN013','name'=>'CD drive','quantity'=>25,'price'=>20.00,'imported'=>true), + array('id'=>'ITN014','name'=>'DVD drive','quantity'=>15,'price'=>80.00,'imported'=>true), + array('id'=>'ITN015','name'=>'Mouse pad','quantity'=>50,'price'=>5.00,'imported'=>false), + array('id'=>'ITN016','name'=>'Network cable','quantity'=>40,'price'=>8.00,'imported'=>true), + array('id'=>'ITN017','name'=>'Case','quantity'=>8,'price'=>65.00,'imported'=>false), + array('id'=>'ITN018','name'=>'Surge protector','quantity'=>45,'price'=>15.00,'imported'=>false), + array('id'=>'ITN019','name'=>'Speaker','quantity'=>35,'price'=>65.00,'imported'=>false), + ); + } + + protected function onLoad($param) + { + parent::onLoad($param); + if(!$this->IsPostBack) + { + $this->Repeater->DataSource=$this->getData(); + $this->Repeater->dataBind(); + } + } +} + +?> \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample2.page b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample2.page new file mode 100644 index 00000000..174f132c --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample2.page @@ -0,0 +1,55 @@ + + +

TRepeater Sample 2

+ + + + + + + + + + + + + + + + + + +
Regional Personnel
<%#$this->Parent->DataItem %> + + + + + + + + + + + + + + + + + + + + + + + +
<%#$this->Parent->DataItem['name'] %><%#$this->Parent->DataItem['age'] %><%#$this->Parent->DataItem['position'] %>
<%#$this->Parent->DataItem['name'] %><%#$this->Parent->DataItem['age'] %><%#$this->Parent->DataItem['position'] %>
+ + +
+
+ + +
+ +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample2.php b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample2.php new file mode 100644 index 00000000..59d01f57 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample2.php @@ -0,0 +1,56 @@ +array( + array('name'=>'John','age'=>30,'position'=>'Program Manager'), + array('name'=>'Edward','age'=>35,'position'=>'Developer'), + array('name'=>'Walter','age'=>28,'position'=>'Developer'), + ), + 'West'=>array( + array('name'=>'Cary','age'=>31,'position'=>'Senior Manager'), + array('name'=>'Ted','age'=>25,'position'=>'Developer'), + array('name'=>'Kevin','age'=>28,'position'=>'Developer'), + ), + 'East'=>array( + array('name'=>'Shawn','age'=>30,'position'=>'Sales Manager'), + array('name'=>'Larry','age'=>28,'position'=>'Document Writer'), + ), + 'South'=>array( + array('name'=>'King','age'=>30,'position'=>'Program Manager'), + array('name'=>'Carter','age'=>22,'position'=>'Developer'), + ), + ); + return $data[$region]; + } + + protected function onLoad($param) + { + parent::onLoad($param); + if(!$this->IsPostBack) + { + $this->Repeater->DataSource=$this->getMasterData(); + $this->Repeater->dataBind(); + } + } + + public function dataBindRepeater2($sender,$param) + { + $item=$param->Item; + if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem') + { + $item->Repeater2->DataSource=$this->getDetailData($item->DataItem); + $item->Repeater2->dataBind(); + } + } +} + +?> \ No newline at end of file -- cgit v1.2.3