summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets/protected/pages/Ticket900.php
blob: 5e8a1d07d149c527439a52a5d6c9b57d783d7cc8 (plain)
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
<?php
class Ticket900 extends TPage {
	
    public function onLoad($param)
    {
        parent::onLoad($param);
        if(!$this->IsPostBack)
        {
            $this->DataGrid->DataSource=$this->Data;
            $this->DataGrid->dataBind();
        }
    }
 
 
    protected function getData()
    {
	return array(
		array( 'title' => 'Title A'),
		array( 'title' => 'Title B'),
		array( 'title' => 'Title C')
	);
    }
 
 
    public function editItem($sender,$param)
    {
	$this->CommandName->Text='edit';
        $this->DataGrid->EditItemIndex=$param->Item->ItemIndex;
        $this->DataGrid->DataSource=$this->Data;
        $this->DataGrid->dataBind();
    }
 
    public function saveItem($sender,$param)
    {
	$this->CommandName->Text='save';
        $this->DataGrid->EditItemIndex=-1;
        $this->DataGrid->DataSource=$this->Data;
        $this->DataGrid->dataBind();
    }
 
    public function cancelItem($sender,$param)
    {
	$this->CommandName->Text='cancel';
        $this->DataGrid->EditItemIndex=-1;
        $this->DataGrid->DataSource=$this->Data;
        $this->DataGrid->dataBind();
    }
 
    public function deleteItem($sender,$param)
    {
	$this->CommandName->Text='delete';
        $this->DataGrid->EditItemIndex=-1;
        $this->DataGrid->DataSource=$this->Data;
        $this->DataGrid->dataBind();
    }
	
}