Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
Prado::using('Application.pages.Controls.Samples.TDataGrid.Sample1');
4
 
5
class Sample5 extends Sample1
6
{
7
	public function changePage($sender,$param)
8
	{
9
		$this->DataGrid->CurrentPageIndex=$param->NewPageIndex;
10
		$this->DataGrid->DataSource=$this->Data;
11
		$this->DataGrid->dataBind();
12
	}
13
 
14
	public function pagerCreated($sender,$param)
15
	{
16
		$param->Pager->Controls->insertAt(0,'Page: ');
17
	}
18
 
19
	public function changePagerPosition($sender,$param)
20
	{
21
		$top=$sender->Items[0]->Selected;
22
		$bottom=$sender->Items[1]->Selected;
23
		if($top && $bottom)
24
			$position='TopAndBottom';
25
		else if($top)
26
			$position='Top';
27
		else if($bottom)
28
			$position='Bottom';
29
		else
30
			$position='';
31
		if($position==='')
32
			$this->DataGrid->PagerStyle->Visible=false;
33
		else
34
		{
35
			$this->DataGrid->PagerStyle->Position=$position;
36
			$this->DataGrid->PagerStyle->Visible=true;
37
		}
38
	}
39
 
40
	public function useNumericPager($sender,$param)
41
	{
42
		$this->DataGrid->PagerStyle->Mode='Numeric';
43
		$this->DataGrid->PagerStyle->NextPageText=$this->NextPageText->Text;
44
		$this->DataGrid->PagerStyle->PrevPageText=$this->PrevPageText->Text;
45
		$this->DataGrid->PagerStyle->PageButtonCount=$this->PageButtonCount->Text;
46
		$this->DataGrid->DataSource=$this->Data;
47
		$this->DataGrid->dataBind();
48
	}
49
 
50
	public function useNextPrevPager($sender,$param)
51
	{
52
		$this->DataGrid->PagerStyle->Mode='NextPrev';
53
		$this->DataGrid->PagerStyle->NextPageText=$this->NextPageText->Text;
54
		$this->DataGrid->PagerStyle->PrevPageText=$this->PrevPageText->Text;
55
		$this->DataGrid->DataSource=$this->Data;
56
		$this->DataGrid->dataBind();
57
	}
58
 
59
	public function changePageSize($sender,$param)
60
	{
61
		$this->DataGrid->PageSize=TPropertyValue::ensureInteger($this->PageSize->Text);
62
		$this->DataGrid->CurrentPageIndex=0;
63
		$this->DataGrid->DataSource=$this->Data;
64
		$this->DataGrid->dataBind();
65
	}
66
}
67
 
68
?>