summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php
blob: 50a69911e31e505c04e6a00674ed3a2c147eb545 (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
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
87
88
89
90
91
92
93
94
<?php

// $Id: Home.php -1   $
class Home extends TPage
{
	public function buttonCallback ($sender, $param)
	{
		switch($this->radio1->SelectedValue)
		{
			case 1:
				$this->getCallbackClient()->evaluateScript("alert('something');");
				break;
			case 2:
				$this->getCallbackClient()->check($this->check1, !$this->check1->Checked);
				break;
			case 3:
				$this->getCallbackClient()->hide($this->label1);
				break;
			case 4:
				$this->getCallbackClient()->show($this->label1);
				break;
			case 5:
				$this->getCallbackClient()->toggle($this->label1);
				break;
			case 6:
				$this->getCallbackClient()->toggle($this->label1, 'fade');
				break;
			case 7:
				$this->getCallbackClient()->toggle($this->label1, 'slide');
				break;
			case 8:
				$this->getCallbackClient()->highlight($this->label1);
				break;
			case 9:
				$this->getCallbackClient()->focus($this->txt1);
				break;
			case 10:
				$this->getCallbackClient()->scrollTo($this->check1, array('duration' => 1000, 'offset' => 10));
				break;
			case 11:
				$this->getCallbackClient()->addCssClass($this->txt1, 'red_background');
				break;
			case 12:
				$this->getCallbackClient()->removeCssClass($this->txt1, 'red_background');
				break;
			case 13:
				$this->getCallbackClient()->jQuery($this->txt1, 'animate', array(
					array(	'width' => '+=100',
							'height' => '+=50'
						),
					array(
							'duration' => 1000,
						)
					));
				break;
			case 14:
				$this->getCallbackClient()->setAttribute($this->txt1, 'disabled', true);
				break;
			case 15:
				$this->getCallbackClient()->setStyle($this->pan1, array('background-color' => 'blue'));
				break;
			case 16:
				$this->getCallbackClient()->prependContent($this->pan1, 'prepend<br/>');
				$this->getCallbackClient()->appendContent($this->pan1, '<br/>append');
				break;
			case 17:
				$this->getCallbackClient()->insertContentBefore($this->pan1, 'before');
				$this->getCallbackClient()->insertContentAfter($this->pan1, 'after');
				break;
			case 18:
				$this->getCallbackClient()->replaceContent($this->pan1, 'No more Panel 1');
				break;
			case 19:
				$this->getCallbackClient()->remove($this->txt1);
				break;
			case 20:
				$this->getCallbackClient()->fadeOut($this->txt1);
				break;
			case 21:
				$this->getCallbackClient()->fadeIn($this->txt1);
				break;
			case 22:
				$this->getCallbackClient()->click($this->pan1);
				// alternative
				// $this->getCallbackClient()->raiseClientEvent($this->pan1, 'click');
				break;
			case 23:
				$this->getCallbackClient()->jQuery($this->txt1, 'toggle');
				break;

		}
	}
}