diff options
3 files changed, 69 insertions, 3 deletions
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page index b5a207c0..6c61f7df 100644 --- a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.page @@ -15,8 +15,12 @@ <tr><td class="samplenote"> Default options with a little css applied: </td><td class="sampleaction"> - <com:TJuiResizable CssClass="resizable"> - Resize me! + <com:TJuiResizable + CssClass="resizable" + OnStart="resize1_start" + OnStop="resize1_stop" + > + <com:TActiveLabel ID="label1" Text="Resize me!" /> </com:TJuiResizable> </td></tr> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.php new file mode 100644 index 00000000..435b8a9b --- /dev/null +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiResizable/Home.php @@ -0,0 +1,16 @@ +<?php + +class Home extends TPage +{ + protected function resize1_start($sender, $param) + { + $size=$param->getCallbackParameter()->size; + $this->label1->Text.="<br/>Start: ".intval($size->width)." x ".intval($size->height); + } + + protected function resize1_stop($sender, $param) + { + $size=$param->getCallbackParameter()->size; + $this->label1->Text.="<br/>Stop: ".intval($size->width)." x ".intval($size->height); + } +}
\ No newline at end of file diff --git a/framework/Web/UI/JuiControls/TJuiResizable.php b/framework/Web/UI/JuiControls/TJuiResizable.php index e5b3b531..5e1f8d31 100644 --- a/framework/Web/UI/JuiControls/TJuiResizable.php +++ b/framework/Web/UI/JuiControls/TJuiResizable.php @@ -37,7 +37,7 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel'); * @package System.Web.UI.JuiControls * @since 3.3 */ -class TJuiResizable extends TActivePanel implements IJuiOptions +class TJuiResizable extends TActivePanel implements IJuiOptions, ICallbackEventHandler { protected $_options; @@ -104,4 +104,50 @@ class TJuiResizable extends TActivePanel implements IJuiOptions $code="jQuery('#".$this->getClientId()."').resizable(".$options.");"; $cs->registerEndScript(sprintf('%08X', crc32($code)), $code); } + + /** + * Raises callback event. This method is required by the {@link ICallbackEventHandler} + * interface. + * @param TCallbackEventParameter the parameter associated with the callback event + */ + public function raiseCallbackEvent($param) + { + $this->getOptions()->raiseCallbackEvent($param); + } + + /** + * Raises the OnCreate event + * @param object $params event parameters + */ + public function onCreate ($params) + { + $this->raiseEvent('OnCreate', $this, $params); + } + + /** + * Raises the OnResize event + * @param object $params event parameters + */ + public function onResize ($params) + { + $this->raiseEvent('OnResize', $this, $params); + } + + /** + * Raises the OnStart event + * @param object $params event parameters + */ + public function onStart ($params) + { + $this->raiseEvent('OnStart', $this, $params); + } + + /** + * Raises the OnStop event + * @param object $params event parameters + */ + public function onStop ($params) + { + $this->raiseEvent('OnStop', $this, $params); + } } |