Template file: Sample1.page
Class file: Sample1.php
Template file: Sample2.page
Class file: Sample2.php
Template file: Sample3.page
Class file: Sample3.php
Template file: Sample4.page
Class file: Sample4.php
Template file: Sample5.page
Class file: Sample5.php

/ActiveControls/Samples/TActiveDataGrid/Sample2.php

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