-
- * TActiveDataList
+ TActiveDataList
is used to display or modify a list of data items. It is the
active counterpart to the original TDataList control.
-
- * TActiveDataGrid
+ TActiveDataGrid
displays data in a tabular format with rows and columns. It is the
active counterpart to the original TDataGrid control.
-
- * TActiveRepeater
+ TActiveRepeater
displays its content defined in templates repeatedly based on the given data.
It is the active counterpart to the original TRepeater control.
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.page
index db537902..967cdf6f 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.page
@@ -3,6 +3,7 @@
TActiveDataGrid Sample 1
Using Automatically Generated Columns
+
-$Id: Sample1.page 1650 2007-01-24 06:55:32Z wei $
\ No newline at end of file
+$Id: Sample1.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.php
index ec78006b..ada1ee6e 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.php
@@ -27,14 +27,10 @@ class Sample1 extends TPage
);
}
- public function onLoad($param)
+ public function buttonClicked($sender, $param)
{
- parent::onLoad($param);
- if(!$this->IsPostBack)
- {
- $this->DataGrid->DataSource=$this->Data;
- $this->DataGrid->dataBind();
- }
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
}
}
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.page
index 851fd157..176f14c8 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.page
@@ -14,18 +14,18 @@
ItemStyle.Font.Italic="true"
AlternatingItemStyle.BackColor="#E6ECFF">
-
-
-
-
-
+
Rating
-
+
+ OnSelectedIndexChanged="toggleColumnVisibility">
@@ -62,4 +61,4 @@
-$Id: Sample2.page 1650 2007-01-24 06:55:32Z wei $
\ No newline at end of file
+$Id: Sample2.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.php
index 486d9d51..3831582d 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.php
@@ -67,7 +67,7 @@ class Sample2 extends TPage
public function onLoad($param)
{
parent::onLoad($param);
- if(!$this->IsPostBack)
+ if(!$this->IsPostBack && !$this->IsCallBack)
{
$this->DataGrid->DataSource=$this->Data;
$this->DataGrid->dataBind();
@@ -81,11 +81,6 @@ class Sample2 extends TPage
$this->DataGrid->DataSource=$this->Data;
$this->DataGrid->dataBind();
}
-
- public function redraw($sender,$param)
- {
- $this->DataGrid->render($param->NewWriter);
- }
}
?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.page
index 94aa95fe..4da3aa93 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.page
@@ -50,7 +50,7 @@
HeaderText="In-stock"
DataField="instock"
/>
-
-$Id: Sample3.page 1650 2007-01-24 06:55:32Z wei $
\ No newline at end of file
+$Id: Sample3.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.php
index bb18f36b..9768ca31 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.php
@@ -125,7 +125,7 @@ class Sample3 extends TPage
public function onLoad($param)
{
parent::onLoad($param);
- if(!$this->IsPostBack)
+ if(!$this->IsPostBack && !$this->IsCallBack)
{
$this->DataGrid->DataSource=$this->Data;
$this->DataGrid->dataBind();
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.page
index 76a2bb86..485c8621 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.page
@@ -52,4 +52,4 @@
-$Id: Sample4.page 1650 2007-01-24 06:55:32Z wei $
\ No newline at end of file
+$Id: Sample4.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php
index 80a9c8bc..eb1a0e5b 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php
@@ -11,7 +11,7 @@ class Sample4 extends Sample2
return $data ;
}
- public function sorTActiveDataGrid($sender,$param)
+ public function sortDataGrid($sender,$param)
{
$this->DataGrid->DataSource=$this->sortData($this->Data,$param->SortExpression);
$this->DataGrid->dataBind();
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.page
index a912c0d3..e2b99057 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.page
@@ -22,41 +22,4 @@
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-Next Page Text:
-
-Prev Page Text:
-
-
-
-
-
-
-Page Button Count:
-
-
-
-
-
-
-
-
-
-
-
-$Id: Sample5.page 1650 2007-01-24 06:55:32Z wei $
\ No newline at end of file
+$Id: Sample5.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php
index 37347c7b..95bf9a0e 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php
@@ -4,6 +4,17 @@ Prado::using('Application.pages.ActiveControls.Samples.TActiveDataGrid.Sample1')
class Sample5 extends Sample1
{
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostback && ! $this->IsCallback)
+ {
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+ }
+
public function changePage($sender,$param)
{
$this->DataGrid->CurrentPageIndex=$param->NewPageIndex;
@@ -63,11 +74,6 @@ class Sample5 extends Sample1
$this->DataGrid->DataSource=$this->Data;
$this->DataGrid->dataBind();
}
-
- public function redrawDG ($sender, $param)
- {
- $this->DataGrid->render($param->newWriter);
- }
}
?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample6.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample6.page
deleted file mode 100644
index dd3fcdf8..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample6.page
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-TActiveDataGrid Sample 6
-Custom Paging
-
-
-
-
-
-$Id: Sample6.page 1650 2007-01-24 06:55:32Z wei $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample6.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample6.php
deleted file mode 100644
index 7b217e24..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample6.php
+++ /dev/null
@@ -1,56 +0,0 @@
-getData();
- $page=array();
- for($i=0;$i<$rows;++$i)
- {
- if($offset+$i<$this->getRowCount())
- $page[$i]=$data[$offset+$i];
- }
- return $page;
- }
-
- /**
- * Returns total number of data rows.
- * In real DB applications, this may be replaced by an SQL select
- * query with count().
- * @return integer total number of data rows
- */
- protected function getRowCount()
- {
- return 19;
- }
-
- public function onLoad($param)
- {
- if(!$this->IsPostBack)
- {
- $this->DataGrid->DataSource=$this->getDataRows(0,$this->DataGrid->PageSize);
- $this->DataGrid->dataBind();
- }
- }
-
- public function changePage($sender,$param)
- {
- $this->DataGrid->CurrentPageIndex=$param->NewPageIndex;
- $offset=$param->NewPageIndex*$this->DataGrid->PageSize;
- $this->DataGrid->DataSource=$this->getDataRows($offset,$this->DataGrid->PageSize);
- $this->DataGrid->dataBind();
- }
-}
-
-?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataList/Home.page
new file mode 100644
index 00000000..ebd88424
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataList/Home.page
@@ -0,0 +1,125 @@
+
+
+TActiveDataList Sample
+
+
+
+
+Computer Parts
+
+
+
+
+
+
+ DataItem['id']%>
+ CommandName="select"
+ />
+ <%#$this->DataItem['name']%>
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+ ID | Name | Quantity | Price |
+
+
+ <%#$this->DataItem['id'] %> |
+ <%#$this->DataItem['name'] %> |
+ <%#$this->DataItem['quantity'] %> |
+ $<%#$this->DataItem['price'] %> |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+ ID |
+ <%#$this->DataItem['id']%> |
+
+
+ Name |
+ DataItem['name'] %>
+ />
+ |
+
+
+ Quantity |
+ DataItem['quantity'] %>
+ />
+ |
+
+
+ Price |
+ DataItem['price'] %>
+ />
+ |
+
+
+ Imported |
+ DataItem['imported'] %>
+ />
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+$Id$
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataList/Home.php
new file mode 100644
index 00000000..c62a239d
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataList/Home.php
@@ -0,0 +1,132 @@
+_data===null)
+ $this->loadData();
+ return $this->_data;
+ }
+
+ protected function loadData()
+ {
+ // We use viewstate keep track of data.
+ // In real applications, data should come from database using an SQL SELECT statement.
+ // In the following tabular data, field 'id' is the primary key.
+ // All update and delete operations should come with an 'id' value in order to go through.
+ if(($this->_data=$this->getViewState('Data',null))===null)
+ {
+ $this->_data=array(
+ array('id'=>'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'=>false),
+ 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'=>true),
+ array('id'=>'ITN007','name'=>'Monitor','quantity'=>2,'price'=>300.00,'imported'=>false),
+ );
+ $this->saveData();
+ }
+ }
+
+ protected function saveData()
+ {
+ $this->setViewState('Data',$this->_data);
+ }
+
+ protected function updateProduct($id,$name,$quantity,$price,$imported)
+ {
+ // In real applications, data should be saved to database using an SQL UPDATE statement
+ if($this->_data===null)
+ $this->loadData();
+ $updateRow=null;
+ foreach($this->_data as $index=>$row)
+ if($row['id']===$id)
+ $updateRow=&$this->_data[$index];
+ if($updateRow!==null)
+ {
+ $updateRow['name']=$name;
+ $updateRow['quantity']=TPropertyValue::ensureInteger($quantity);
+ $updateRow['price']=TPropertyValue::ensureFloat($price);
+ $updateRow['imported']=TPropertyValue::ensureBoolean($imported);
+ $this->saveData();
+ }
+ }
+
+ protected function deleteProduct($id)
+ {
+ // In real applications, data should be saved to database using an SQL DELETE statement
+ if($this->_data===null)
+ $this->loadData();
+ $deleteIndex=-1;
+ foreach($this->_data as $index=>$row)
+ if($row['id']===$id)
+ $deleteIndex=$index;
+ if($deleteIndex>=0)
+ {
+ unset($this->_data[$deleteIndex]);
+ $this->saveData();
+ }
+ }
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ {
+ $this->DataList->DataSource=$this->Data;
+ $this->DataList->dataBind();
+ }
+ }
+
+ public function editItem($sender,$param)
+ {
+ $this->DataList->SelectedItemIndex=-1;
+ $this->DataList->EditItemIndex=$param->Item->ItemIndex;
+ $this->DataList->DataSource=$this->Data;
+ $this->DataList->dataBind();
+ }
+
+ public function cancelItem($sender,$param)
+ {
+ $this->DataList->SelectedItemIndex=-1;
+ $this->DataList->EditItemIndex=-1;
+ $this->DataList->DataSource=$this->Data;
+ $this->DataList->dataBind();
+ }
+
+ public function updateItem($sender,$param)
+ {
+ $item=$param->Item;
+ $this->updateProduct(
+ $this->DataList->DataKeys[$item->ItemIndex],
+ $item->ProductName->Text,
+ $item->ProductQuantity->Text,
+ $item->ProductPrice->Text,
+ $item->ProductImported->Checked);
+ $this->DataList->EditItemIndex=-1;
+ $this->DataList->DataSource=$this->Data;
+ $this->DataList->dataBind();
+ }
+
+ public function deleteItem($sender,$param)
+ {
+ $this->deleteProduct($this->DataList->DataKeys[$param->Item->ItemIndex]);
+ $this->DataList->SelectedItemIndex=-1;
+ $this->DataList->EditItemIndex=-1;
+ $this->DataList->DataSource=$this->Data;
+ $this->DataList->dataBind();
+ }
+
+ public function selectItem($sender,$param)
+ {
+ $this->DataList->EditItemIndex=-1;
+ $this->DataList->DataSource=$this->Data;
+ $this->DataList->dataBind();
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Home.page
new file mode 100644
index 00000000..4d855cbc
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Home.page
@@ -0,0 +1,92 @@
+
+
+TActiveRepeater Sample
+
+
+The following example allows users to modify the existing tabular data using a TActiveRepeater. Two validators are used in the repeater to ensure the validity of user inputs. One is to ensure product names are not empty, the other ensures product prices are valid numeric format. After clicking on the save button, the input data is displayed in a table at the bottom of the page.
+
+
+
+
+ Name |
+ Category |
+ Price |
+ Imported |
+
+
+
+
+
+ Data['name']%> />
+ |
+
+
+ |
+
+ Data['price']%> />
+ |
+
+ Data['imported']%> />
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ID |
+ Name |
+ Category |
+ Price |
+ Imported |
+
+
+
+
+
+<%#$this->Data['id']%> |
+<%#$this->Data['name']%> |
+<%#$this->Data['category']%> |
+<%#$this->Data['price']%> |
+<%#$this->Data['imported']?'Yes':'No'%> |
+
+
+
+
+
+Computer Parts Inventory |
+
+
+
+
+
+
+
+
+$Id: Sample3.page 1688 2007-02-09 22:48:31Z xue $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Home.php
new file mode 100644
index 00000000..f7c8d61c
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Home.php
@@ -0,0 +1,79 @@
+'ITN001','name'=>'Motherboard','category'=>'CAT004','price'=>100.00,'imported'=>true),
+ array('id'=>'ITN002','name'=>'CPU','category'=>'CAT004','price'=>150.00,'imported'=>true),
+ array('id'=>'ITN003','name'=>'Harddrive','category'=>'CAT003','price'=>80.00,'imported'=>true),
+ array('id'=>'ITN006','name'=>'Keyboard','category'=>'CAT002','price'=>20.00,'imported'=>false),
+ array('id'=>'ITN008','name'=>'CDRW drive','category'=>'CAT003','price'=>40.00,'imported'=>true),
+ array('id'=>'ITN009','name'=>'Cooling fan','category'=>'CAT001','price'=>10.00,'imported'=>false),
+ array('id'=>'ITN012','name'=>'Floppy drive','category'=>'CAT003','price'=>12.00,'imported'=>false),
+ array('id'=>'ITN013','name'=>'CD drive','category'=>'CAT003','price'=>20.00,'imported'=>true),
+ array('id'=>'ITN014','name'=>'DVD drive','category'=>'CAT003','price'=>80.00,'imported'=>true),
+ array('id'=>'ITN015','name'=>'Mouse pad','category'=>'CAT001','price'=>5.00,'imported'=>false),
+ );
+ }
+
+ protected function getCategories()
+ {
+ return array(
+ array('id'=>'CAT001','name'=>'Accessories'),
+ array('id'=>'CAT002','name'=>'Input Devices'),
+ array('id'=>'CAT003','name'=>'Drives'),
+ array('id'=>'CAT004','name'=>'Barebone'),
+ );
+ }
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ {
+ $this->Repeater->DataSource=$this->Products;
+ $this->Repeater->dataBind();
+ }
+ }
+
+ public function repeaterDataBound($sender,$param)
+ {
+ $item=$param->Item;
+ if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
+ {
+ $item->ProductCategory->DataSource=$this->Categories;
+ $item->ProductCategory->DataTextField='name';
+ $item->ProductCategory->DataValueField='id';
+ $item->ProductCategory->dataBind();
+ $item->ProductCategory->SelectedValue=$item->DataItem['category'];
+ }
+ }
+
+ public function saveInput($sender,$param)
+ {
+ if($this->IsValid)
+ {
+ $index=0;
+ $products=$this->Products;
+ $data=array();
+ foreach($this->Repeater->Items as $item)
+ {
+ $item=array(
+ 'id'=>$products[$index]['id'],
+ 'name'=>$item->ProductName->Text,
+ 'category'=>$item->ProductCategory->SelectedItem->Text,
+ 'price'=>TPropertyValue::ensureFloat($item->ProductPrice->Text),
+ 'imported'=>$item->ProductImported->Checked,
+ );
+ $data[]=$item;
+ $index++;
+ }
+ $this->Repeater2->DataSource=$data;
+ $this->Repeater2->dataBind();
+ }
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/RegionDisplay.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/RegionDisplay.php
deleted file mode 100644
index 40d1841e..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/RegionDisplay.php
+++ /dev/null
@@ -1,28 +0,0 @@
-Data 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++;
- }
-}
-
-?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/RegionDisplay.tpl b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/RegionDisplay.tpl
deleted file mode 100644
index 0ab9b164..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/RegionDisplay.tpl
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- <%#$this->Data['name'] %>
-
-
- <%#$this->Data['age'] %>
-
-
- <%#$this->Data['position'] %>
-
-
-
-
-
-
-
-
-
- |
-
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample1.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample1.page
deleted file mode 100644
index ec740487..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample1.page
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-TActiveRepeater Sample 1
-
-
-
-
-
-
- ID |
- Name |
- Quantity |
- Price |
- Imported |
-
-
-
-
-
-<%#$this->Data['id']%> |
-<%#$this->Data['name']%> |
-<%#$this->Data['quantity']%> |
-<%#$this->Data['price']%> |
-<%#$this->Data['imported']?'Yes':'No'%> |
-
-
-
-
-
-<%#$this->Data['id']%> |
-<%#$this->Data['name']%> |
-<%#$this->Data['quantity']%> |
-<%#$this->Data['price']%> |
-<%#$this->Data['imported']?'Yes':'No'%> |
-
-
-
-
-
-Computer Parts Inventory |
-
-
-
-
-
-
-$Id: Sample1.page 1688 2007-02-09 22:48:31Z xue $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample1.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample1.php
deleted file mode 100644
index 905a3b8d..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample1.php
+++ /dev/null
@@ -1,41 +0,0 @@
-'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),
- );
- }
-
- public 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/ActiveControls/Samples/TActiveRepeater/Sample2.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample2.page
deleted file mode 100644
index bdb6ec2f..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample2.page
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-TActiveRepeater Sample 2
-
-
-
-
-
-
-
-
-
-
- <%#$this->Data %>
-
-
-
-
-
-
-
-
-
-
-
- <%#$this->Data['name'] %>
-
-
- <%#$this->Data['age'] %>
-
-
- <%#$this->Data['position'] %>
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
-
-
-$Id: Sample2.page 1688 2007-02-09 22:48:31Z xue $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample2.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample2.php
deleted file mode 100644
index e84580a2..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample2.php
+++ /dev/null
@@ -1,79 +0,0 @@
-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];
- }
-
- public 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();
- }
- }
-
- public function repeaterItemCreated($sender,$param)
- {
- static $itemIndex=0;
- $item=$param->Item;
- if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
- {
- $item->Cell->BackColor=$itemIndex%2 ? "#6078BF" : "#809FFF";
- $item->Cell->ForeColor='white';
- $itemIndex++;
- }
- }
-
- public function repeater2ItemCreated($sender,$param)
- {
- static $itemIndex=0;
- $item=$param->Item;
- if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
- {
- $item->Row->BackColor=$itemIndex%2 ? "#BFCFFF" : "#E6ECFF";
- $itemIndex++;
- }
- }
-}
-
-?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.page
deleted file mode 100644
index 1ea4e9dc..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.page
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-TActiveRepeater Sample 3
-
-
-The following example allows users to modify the existing tabular data using a TActiveRepeater. Two validators are used in the repeater to ensure the validity of user inputs. One is to ensure product names are not empty, the other ensures product prices are valid numeric format. After clicking on the save button, the input data is displayed in a table at the bottom of the page.
-
-
-
-
- Name |
- Category |
- Price |
- Imported |
-
-
-
-
-
- Data['name']%>
- AutoPostBack="true"
- OnTextChanged="Page.saveInput"
- OnCallback="Page.renderRepeater2"/>
- |
-
-
- |
-
- Data['price']%>
- AutoPostBack="true"
- OnTextChanged="Page.saveInput"
- OnCallback="Page.renderRepeater2"/>
- |
-
- Data['imported']%>
- AutoPostBack="true"
- OnCheckedChanged="Page.saveInput"
- OnCallback="Page.renderRepeater2"/>
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ID |
- Name |
- Category |
- Price |
- Imported |
-
-
-
-
-
-<%#$this->Data['id']%> |
-<%#$this->Data['name']%> |
-<%#$this->Data['category']%> |
-<%#$this->Data['price']%> |
-<%#$this->Data['imported']?'Yes':'No'%> |
-
-
-
-
-
-Computer Parts Inventory |
-
-
-
-
-
-
-
-
-$Id: Sample3.page 1688 2007-02-09 22:48:31Z xue $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php
deleted file mode 100644
index 4cb5fafd..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample3.php
+++ /dev/null
@@ -1,84 +0,0 @@
-'ITN001','name'=>'Motherboard','category'=>'CAT004','price'=>100.00,'imported'=>true),
- array('id'=>'ITN002','name'=>'CPU','category'=>'CAT004','price'=>150.00,'imported'=>true),
- array('id'=>'ITN003','name'=>'Harddrive','category'=>'CAT003','price'=>80.00,'imported'=>true),
- array('id'=>'ITN006','name'=>'Keyboard','category'=>'CAT002','price'=>20.00,'imported'=>false),
- array('id'=>'ITN008','name'=>'CDRW drive','category'=>'CAT003','price'=>40.00,'imported'=>true),
- array('id'=>'ITN009','name'=>'Cooling fan','category'=>'CAT001','price'=>10.00,'imported'=>false),
- array('id'=>'ITN012','name'=>'Floppy drive','category'=>'CAT003','price'=>12.00,'imported'=>false),
- array('id'=>'ITN013','name'=>'CD drive','category'=>'CAT003','price'=>20.00,'imported'=>true),
- array('id'=>'ITN014','name'=>'DVD drive','category'=>'CAT003','price'=>80.00,'imported'=>true),
- array('id'=>'ITN015','name'=>'Mouse pad','category'=>'CAT001','price'=>5.00,'imported'=>false),
- );
- }
-
- protected function getCategories()
- {
- return array(
- array('id'=>'CAT001','name'=>'Accessories'),
- array('id'=>'CAT002','name'=>'Input Devices'),
- array('id'=>'CAT003','name'=>'Drives'),
- array('id'=>'CAT004','name'=>'Barebone'),
- );
- }
-
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack && ! $this->IsCallBack)
- {
- $this->Repeater->DataSource=$this->Products;
- $this->Repeater->dataBind();
- }
- }
-
- public function repeaterDataBound($sender,$param)
- {
- $item=$param->Item;
- if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
- {
- $item->ProductCategory->DataSource=$this->Categories;
- $item->ProductCategory->DataTextField='name';
- $item->ProductCategory->DataValueField='id';
- $item->ProductCategory->dataBind();
- $item->ProductCategory->SelectedValue=$item->DataItem['category'];
- }
- }
-
- public function saveInput($sender,$param)
- {
- if($this->IsValid)
- {
- $index=0;
- $products=$this->Products;
- $data=array();
- foreach($this->Repeater->Items as $item)
- {
- $item=array(
- 'id'=>$products[$index]['id'],
- 'name'=>$item->ProductName->Text,
- 'category'=>$item->ProductCategory->SelectedItem->Text,
- 'price'=>TPropertyValue::ensureFloat($item->ProductPrice->Text),
- 'imported'=>$item->ProductImported->Checked,
- );
- $data[]=$item;
- $index++;
- }
- $this->Repeater2->DataSource=$data;
- $this->Repeater2->dataBind();
- }
- }
-
- public function renderRepeater2 ($sender, $param)
- {
- $this->Repeater2->render($param->getNewWriter());
- }
-}
-
-?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample4.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample4.page
deleted file mode 100644
index b4bb622c..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample4.page
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-TActiveRepeater Sample 4
-
-Please enter the URL of your favorite websites in the following:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-$Id: Sample4.page 1688 2007-02-09 22:48:31Z xue $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample4.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample4.php
deleted file mode 100644
index 0b42436e..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample4.php
+++ /dev/null
@@ -1,43 +0,0 @@
-IsPostBack)
- {
- // use a dummy data source to create 3 repeater items
- $this->Repeater->DataSource=new TDummyDataSource(3);
- $this->Repeater->dataBind();
- }
- }
-
- public function itemCreated($sender,$param)
- {
- // $param->Item refers to the newly created repeater item
- $param->Item->Style="width:300px; margin:10px; margin-left:0px";
- }
-
- public function buttonClicked($sender,$param)
- {
- $links=array();
- foreach($this->Repeater->Items as $textBox)
- {
- if($textBox->Text!=='')
- $links[]=$textBox->Text;
- }
- $this->Repeater2->DataSource=$links;
- $this->Repeater2->dataBind();
- }
-
- public function redrawRepeater2($sender,$param)
- {
- $this->lblResult->setDisplay(TDisplayStyle::Dynamic);
- $this->Repeater2->render($param->NewWriter);
- }
-}
-
-?>
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample5.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample5.page
deleted file mode 100644
index ee9992d9..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample5.page
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-TActiveRepeater Sample 5
-
-
-
-
-
-
-
-
-
-$Id: $
\ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample5.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample5.php
deleted file mode 100644
index 60beb30e..00000000
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Sample5.php
+++ /dev/null
@@ -1,52 +0,0 @@
-'North',
- 'detail'=>array(
- array('name'=>'John','age'=>30,'position'=>'Program Manager'),
- array('name'=>'Edward','age'=>35,'position'=>'Developer'),
- array('name'=>'Walter','age'=>28,'position'=>'Developer'),
- ),
- ),
- array(
- 'name'=>'West',
- 'detail'=>array(
- array('name'=>'Cary','age'=>31,'position'=>'Senior Manager'),
- array('name'=>'Ted','age'=>25,'position'=>'Developer'),
- array('name'=>'Kevin','age'=>28,'position'=>'Developer'),
- ),
- ),
- array(
- 'name'=>'East',
- 'detail'=>array(
- array('name'=>'Shawn','age'=>30,'position'=>'Sales Manager'),
- array('name'=>'Larry','age'=>28,'position'=>'Document Writer'),
- ),
- ),
- array(
- 'name'=>'South',
- 'detail'=>array(
- array('name'=>'King','age'=>30,'position'=>'Program Manager'),
- array('name'=>'Carter','age'=>22,'position'=>'Developer'),
- ),
- ),
- );
- }
-
- public 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/DataGrid.page b/demos/quickstart/protected/pages/Controls/DataGrid.page
index bc700449..85a53011 100644
--- a/demos/quickstart/protected/pages/Controls/DataGrid.page
+++ b/demos/quickstart/protected/pages/Controls/DataGrid.page
@@ -1,6 +1,7 @@
TDataGrid
+
TDatagrid is an important control in building complex Web applications. It displays data in a tabular format with rows (also called items) and columns. A row is composed by cells, while columns govern how cells should be displayed according to their association with the columns. Data specified via DataSource or DataSourceID are bound to the rows and feed contents to cells.
@@ -17,7 +18,7 @@ Rows of TDataGrid can be accessed via its Items property. A row (item)
Columns of a data grid determine how the associated cells are displayed. For example, cells associated with a TBoundColumn are displayed differently according to their modes. A cell is displayed as a static text if the cell is in browsing mode, a text box if it is in editing mode, and so on.
-PRADO provides five types of columns:
+PRADO provides eight types of columns:
- TBoundColumn associates cells with a specific field of data and displays the cells according to their modes.
diff --git a/demos/quickstart/protected/pages/Controls/DataList.page b/demos/quickstart/protected/pages/Controls/DataList.page
index d92aa69c..14197f35 100644
--- a/demos/quickstart/protected/pages/Controls/DataList.page
+++ b/demos/quickstart/protected/pages/Controls/DataList.page
@@ -1,6 +1,8 @@
TDataList
+
+
TDataList represents a data bound and updatable list control. Like TRepeater, TDataList displays its content repeatedly based on the data fetched from DataSource. The repeated contents in TDataList are called items, which are controls and can be accessed through Items. When dataBind() is invoked, TDataList creates an item for each row of data and binds the data row to the item. Optionally, a TDataList can have a header, a footer and/or separators between items.
diff --git a/demos/quickstart/protected/pages/Controls/Repeater.page b/demos/quickstart/protected/pages/Controls/Repeater.page
index 1e2ac881..459f8767 100644
--- a/demos/quickstart/protected/pages/Controls/Repeater.page
+++ b/demos/quickstart/protected/pages/Controls/Repeater.page
@@ -1,6 +1,7 @@
TRepeater
+
TRepeater displays its content repeatedly based on the data fetched from DataSource. The repeated contents in TRepeater are called items which are controls accessible through Items property. When dataBind() is invoked, TRepeater creates an item for each row of data and binds the data row to the item. Optionally, a repeater can have a header, a footer and/or separators between items.
diff --git a/framework/Web/UI/ActiveControls/TActiveDataGrid.php b/framework/Web/UI/ActiveControls/TActiveDataGrid.php
index 358bd414..c298bd2a 100644
--- a/framework/Web/UI/ActiveControls/TActiveDataGrid.php
+++ b/framework/Web/UI/ActiveControls/TActiveDataGrid.php
@@ -37,8 +37,13 @@ Prado::using('System.Web.UI.WebControls.TCheckBoxColumn');
*
* There are also active datagrid columns to work with the TActiveDataGrid, which are
* - {@link TActiveBoundColumn}, the active counterpart to {@link TBoundColumn}.
+ * - {@link TActiveLiteralColumn}, the active counterpart to {@link TLiteralColumn}.
+ * - {@link TActiveCheckBoxColumn}, the active counterpart to {@link TCheckBoxColumn}.
+ * - {@link TActiveDropDownListColumn}, the active counterpart to {@link TDropDownListColumn}.
+ * - {@link TActiveHyperLinkColumn}, the active counterpart to {@link THyperLinkColumn}.
* - {@link TActiveEditCommandColumn}, the active counterpart to {@link TEditCommandColumn}.
* - {@link TActiveButtonColumn}, the active counterpart to {@link TButtonColumn}.
+ * - {@link TActiveTemplateColumn}, the active counterpart to {@link TTemplateColumn}.
*
* Please refer to the original documentation of the regular counterparts for usage.
*
diff --git a/framework/Web/UI/ActiveControls/TActivePanel.php b/framework/Web/UI/ActiveControls/TActivePanel.php
index 25a42eb7..1e7ebbd9 100644
--- a/framework/Web/UI/ActiveControls/TActivePanel.php
+++ b/framework/Web/UI/ActiveControls/TActivePanel.php
@@ -19,10 +19,10 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* TActivePanel is the TPanel active control counterpart.
*
* TActivePanel allows the client-side panel contents to be updated during a
- * callback response using the {@link flush} method.
+ * callback response using the {@link render} method.
*
* Example: Assume $param is an instance of TCallbackEventParameter attached to
- * the OnCallback event a TCallback with ID "callback1", and
+ * the OnCallback event of a TCallback with ID "callback1", and
* "panel1" is the ID of a TActivePanel.
*
* function callback1_requested($sender, $param)
--
cgit v1.2.3