summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php
diff options
context:
space:
mode:
authorChristophe.Boulain <>2009-09-29 08:33:46 +0000
committerChristophe.Boulain <>2009-09-29 08:33:46 +0000
commitd76123127139a7cb013a0e4c17a63eb8aab57e3e (patch)
tree4a6093cec85636f5e595b66f4fb33f77f1d424e1 /demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php
parentb49bc6e7db63f0ae9788970108c4d2f20d841bed (diff)
Added TActiveDataGrid and TActiveRepeater from LCS
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php')
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php73
1 files changed, 73 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php
new file mode 100644
index 00000000..37347c7b
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php
@@ -0,0 +1,73 @@
+<?php
+
+Prado::using('Application.pages.ActiveControls.Samples.TActiveDataGrid.Sample1');
+
+class Sample5 extends Sample1
+{
+ public function changePage($sender,$param)
+ {
+ $this->DataGrid->CurrentPageIndex=$param->NewPageIndex;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function pagerCreated($sender,$param)
+ {
+ $param->Pager->Controls->insertAt(0,'Page: ');
+ }
+
+ public function changePagerPosition($sender,$param)
+ {
+ $top=$sender->Items[0]->Selected;
+ $bottom=$sender->Items[1]->Selected;
+ if($top && $bottom)
+ $position='TopAndBottom';
+ else if($top)
+ $position='Top';
+ else if($bottom)
+ $position='Bottom';
+ else
+ $position='';
+ if($position==='')
+ $this->DataGrid->PagerStyle->Visible=false;
+ else
+ {
+ $this->DataGrid->PagerStyle->Position=$position;
+ $this->DataGrid->PagerStyle->Visible=true;
+ }
+ }
+
+ public function useNumericPager($sender,$param)
+ {
+ $this->DataGrid->PagerStyle->Mode='Numeric';
+ $this->DataGrid->PagerStyle->NextPageText=$this->NextPageText->Text;
+ $this->DataGrid->PagerStyle->PrevPageText=$this->PrevPageText->Text;
+ $this->DataGrid->PagerStyle->PageButtonCount=$this->PageButtonCount->Text;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function useNextPrevPager($sender,$param)
+ {
+ $this->DataGrid->PagerStyle->Mode='NextPrev';
+ $this->DataGrid->PagerStyle->NextPageText=$this->NextPageText->Text;
+ $this->DataGrid->PagerStyle->PrevPageText=$this->PrevPageText->Text;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function changePageSize($sender,$param)
+ {
+ $this->DataGrid->PageSize=TPropertyValue::ensureInteger($this->PageSize->Text);
+ $this->DataGrid->CurrentPageIndex=0;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function redrawDG ($sender, $param)
+ {
+ $this->DataGrid->render($param->newWriter);
+ }
+}
+
+?> \ No newline at end of file