From 8aa0d56705a71894a80c1293730b6c67cddc8a40 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Thu, 2 Jun 2011 09:30:55 +0000 Subject: added documentation for TActiveDataList, TActiveDataGrid and TActiveRepeater class --- .../Samples/TActiveDataGrid/Sample5.php | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php') 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..95bf9a0e --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php @@ -0,0 +1,79 @@ +IsPostback && ! $this->IsCallback) + { + $this->DataGrid->DataSource=$this->Data; + $this->DataGrid->dataBind(); + } + } + + 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(); + } +} + +?> \ No newline at end of file -- cgit v1.2.3