summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid')
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.page3
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.php10
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.page17
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.php7
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.page4
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.php2
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.page2
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php2
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.page39
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php16
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample6.page26
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample6.php56
12 files changed, 31 insertions, 153 deletions
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 @@
<h1>TActiveDataGrid Sample 1</h1>
<h2>Using Automatically Generated Columns</h2>
+<com:TActiveButton ID="button1" Text="click me" OnCallback="buttonClicked" />
<com:TActiveDataGrid
ID="DataGrid"
EnableViewState="false"
@@ -14,4 +15,4 @@
AlternatingItemStyle.BackColor="#E6ECFF"
/>
-<div class="last-modified">$Id: Sample1.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent> \ No newline at end of file
+<div class="last-modified">$Id: Sample1.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $</div></com:TContent> \ 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">
- <com:THyperLinkColumn
+ <com:TActiveHyperLinkColumn
HeaderText="Book Title"
DataTextField="title"
DataNavigateUrlField="ISBN"
DataNavigateUrlFormatString="http://www.amazon.com/gp/product/%s"
Target="_blank"
/>
- <com:TBoundColumn
+ <com:TActiveBoundColumn
HeaderText="Publisher"
DataField="publisher"
/>
- <com:TBoundColumn
+ <com:TActiveBoundColumn
ItemStyle.HorizontalAlign="Right"
ItemStyle.Wrap="false"
ItemStyle.Font.Italic="false"
@@ -34,25 +34,24 @@
DataField="price"
DataFormatString="$%.2f"
/>
- <com:TCheckBoxColumn
+ <com:TActiveCheckBoxColumn
HeaderText="In-stock"
HeaderStyle.Wrap="false"
DataField="instock"
/>
- <com:TTemplateColumn>
+ <com:TActiveTemplateColumn>
<prop:HeaderTemplate>Rating</prop:HeaderTemplate>
<prop:ItemTemplate>
<img src="images/star<%#$this->Parent->DataItem['rating']%>.gif" alt="" />
</prop:ItemTemplate>
- </com:TTemplateColumn>
+ </com:TActiveTemplateColumn>
</com:TActiveDataGrid>
<com:TPanel GroupingText="Column Visibility" Width="200px">
<com:TActiveCheckBoxList
AutoPostBack="true"
- OnSelectedIndexChanged="toggleColumnVisibility"
- OnCallback="redraw">
+ OnSelectedIndexChanged="toggleColumnVisibility">
<com:TListItem Text="Book Title" Selected="true" />
<com:TListItem Text="Publisher" Selected="true" />
<com:TListItem Text="Price" Selected="true" />
@@ -62,4 +61,4 @@
</com:TPanel>
-<div class="last-modified">$Id: Sample2.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent> \ No newline at end of file
+<div class="last-modified">$Id: Sample2.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $</div></com:TContent> \ 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"
/>
- <com:TActiveDropDownListColumn
+ <com:TActiveDropDownListColumn
ID="RatingColumn"
HeaderText="Rating"
DataTextField="rating"
@@ -80,4 +80,4 @@
/>
</com:TActiveDataGrid>
-<div class="last-modified">$Id: Sample3.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent> \ No newline at end of file
+<div class="last-modified">$Id: Sample3.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $</div></com:TContent> \ 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 @@
</com:TActiveTemplateColumn>
</com:TActiveDataGrid>
-<div class="last-modified">$Id: Sample4.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent> \ No newline at end of file
+<div class="last-modified">$Id: Sample4.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $</div></com:TContent> \ 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 @@
/>
</div>
-<com:TActivePanel GroupingText="Pager Visibility" Width="300px">
-
-<com:TActiveCheckBoxList
- AutoPostBack="true"
- RepeatColumns="2"
- OnSelectedIndexChanged="changePagerPosition" OnCallback="redrawDG">
- <com:TListItem Text="Top" />
- <com:TListItem Text="Bottom" Selected="true" />
-</com:TActiveCheckBoxList>
-
-</com:TActivePanel>
-
-<com:TActivePanel GroupingText="Pager Mode" Width="300px">
-
-<com:TActivePanel GroupingText="NextPrev Pager" Width="300px">
-
-Next Page Text:
-<com:TActiveTextBox ID="NextPageText" Text="Next" /><br/>
-Prev Page Text:
-<com:TActiveTextBox ID="PrevPageText" Text="Prev" /><br/>
-<com:TActiveButton Text="Submit" OnClick="useNextPrevPager" OnCallback="redrawDG"/>
-</com:TActivePanel>
-
-<com:TActivePanel GroupingText="Numeric Pager" Width="300px">
-
-Page Button Count:
-<com:TActiveTextBox ID="PageButtonCount" Text="5" /><br/>
-<com:TActiveButton Text="Submit" OnClick="useNumericPager" OnCallback="redrawDG"/>
-</com:TActivePanel>
-
-<com:TActivePanel GroupingText="Page Size" Width="300px">
-<com:TActiveTextBox ID="PageSize" Text="5" /><br/>
-<com:TActiveButton Text="Submit" OnClick="changePageSize" OnCallback="redrawDG"/>
-</com:TActivePanel>
-
-</com:TActivePanel>
-
-<div class="last-modified">$Id: Sample5.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent> \ No newline at end of file
+<div class="last-modified">$Id: Sample5.page 2955 2011-06-02 09:30:55Z ctrlaltca@gmail.com $</div></com:TContent> \ 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 @@
-<com:TContent ID="body">
-
-<h1>TActiveDataGrid Sample 6</h1>
-<h2>Custom Paging</h2>
-
-<div style="width:500px">
-<com:TActiveDataGrid
- ID="DataGrid"
- Width="100%"
- AllowPaging="true"
- AllowCustomPaging="true"
- VirtualItemCount="19"
- PageSize="5"
- PagerStyle.Mode="Numeric"
- PagerStyle.HorizontalAlign="Right"
- CellPadding="2"
- HeaderStyle.BackColor="black"
- HeaderStyle.ForeColor="white"
- ItemStyle.BackColor="#BFCFFF"
- ItemStyle.Font.Italic="true"
- AlternatingItemStyle.BackColor="#E6ECFF"
- OnPageIndexChanged="changePage"
- />
-</div>
-
-<div class="last-modified">$Id: Sample6.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent> \ 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 @@
-<?php
-
-Prado::using('Application.pages.ActiveControls.Samples.TActiveDataGrid.Sample1');
-
-class Sample6 extends Sample1
-{
- /**
- * Returns a subset of data.
- * In MySQL database, this can be replaced by LIMIT clause
- * in an SQL select statement.
- * @param integer the starting index of the row
- * @param integer number of rows to be returned
- * @return array subset of data
- */
- protected function getDataRows($offset,$rows)
- {
- $data=$this->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