Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
class Sample2 extends TPage
4
{
5
	protected function getData()
6
	{
7
		return array(
8
			array(
9
				'ISBN'=>'0596007124',
10
				'title'=>'Head First Design Patterns',
11
				'publisher'=>'O\'Reilly Media, Inc.',
12
				'price'=>29.67,
13
				'instock'=>true,
14
				'rating'=>4,
15
			),
16
			array(
17
				'ISBN'=>'0201633612',
18
				'title'=>'Design Patterns: Elements of Reusable Object-Oriented Software',
19
				'publisher'=>'Addison-Wesley Professional',
20
				'price'=>47.04,
21
				'instock'=>true,
22
				'rating'=>5,
23
			),
24
			array(
25
				'ISBN'=>'0321247140',
26
				'title'=>'Design Patterns Explained : A New Perspective on Object-Oriented Design',
27
				'publisher'=>'Addison-Wesley Professional',
28
				'price'=>37.49,
29
				'instock'=>true,
30
				'rating'=>4,
31
			),
32
			array(
33
				'ISBN'=>'0201485672',
34
				'title'=>'Refactoring: Improving the Design of Existing Code',
35
				'publisher'=>'Addison-Wesley Professional',
36
				'price'=>47.14,
37
				'instock'=>true,
38
				'rating'=>3,
39
			),
40
			array(
41
				'ISBN'=>'0321213351',
42
				'title'=>'Refactoring to Patterns',
43
				'publisher'=>'Addison-Wesley Professional',
44
				'price'=>38.49,
45
				'instock'=>true,
46
				'rating'=>2,
47
			),
48
			array(
49
				'ISBN'=>'0735619670',
50
				'title'=>'Code Complete',
51
				'publisher'=>'Microsoft Press',
52
				'price'=>32.99,
53
				'instock'=>false,
54
				'rating'=>4,
55
			),
56
			array(
57
				'ISBN'=>'0321278658',
58
				'title'=>'Extreme Programming Explained : Embrace Change',
59
				'publisher'=>'Addison-Wesley Professional',
60
				'price'=>34.99,
61
				'instock'=>true,
62
				'rating'=>3,
63
			),
64
		);
65
	}
66
 
67
	public function onLoad($param)
68
	{
69
		parent::onLoad($param);
70
		if(!$this->IsPostBack)
71
		{
72
			$this->DataGrid->DataSource=$this->Data;
73
			$this->DataGrid->dataBind();
74
		}
75
	}
76
 
77
	public function toggleColumnVisibility($sender,$param)
78
	{
79
		foreach($this->DataGrid->Columns as $index=>$column)
80
			$column->Visible=$sender->Items[$index]->Selected;
81
		$this->DataGrid->DataSource=$this->Data;
82
		$this->DataGrid->dataBind();
83
	}
84
}
85
 
86
?>