-
Notifications
You must be signed in to change notification settings - Fork 0
/
_events.php
65 lines (62 loc) · 2.02 KB
/
_events.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
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class MJaxEventBase extends QBaseClass{
protected $objControl = null;
protected $objAction = null;
public function Init($objControl, $objAction){
$this->objControl = $objControl;
$this->objAction = $objAction;
$this->objAction->SetEvent($this);
}
public function Exicute(){
$this->objAction->Exicute($this->objControl->ControlId, $this->objControl->Form->FormId, $this->objControl->ActionParameter);
}
public function GetEventName(){
return $this->strEventName;
}
public function __get($strName) {
switch ($strName) {
case "ControlId": return $this->objControl->ControlId;
default:
try {
return parent::__get($strName);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
/////////////////////////
// Public Properties: SET
/////////////////////////
public function __set($strName, $mixValue) {
switch ($strName) {/*
case "ControlId":
try {
return ($this->strId = QType::Cast($mixValue, QType::String));
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
*/
default:
try {
return parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
}
class MJaxClickEvent extends MJaxEventBase{
protected $strEventName = 'click';
public function Render(){
$strRendered = sprintf("$('#%s').live('click', %s);", $this->objControl->ControlId, $this->objAction->Render());
return $strRendered;
}
}
?>