From 2c1d9d453404ec2e3344ef477bf834a2a3c065af Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 6 Feb 2014 16:23:42 +0100 Subject: Implemented basic support for callback events for JUI controls; TJuiDraggable and TJuiDroppable examples --- framework/Web/UI/JuiControls/TJuiSortable.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'framework/Web/UI/JuiControls/TJuiSortable.php') diff --git a/framework/Web/UI/JuiControls/TJuiSortable.php b/framework/Web/UI/JuiControls/TJuiSortable.php index 557d62ba..e54dbefb 100644 --- a/framework/Web/UI/JuiControls/TJuiSortable.php +++ b/framework/Web/UI/JuiControls/TJuiSortable.php @@ -10,6 +10,7 @@ */ Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter'); +Prado::using('System.Web.UI.ActiveControls.TActivePanel'); /** * TJuiSortable class. @@ -30,6 +31,8 @@ Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter'); */ class TJuiSortable extends TActivePanel implements IJuiOptions, ICallbackEventHandler { + protected $_options; + /** * Creates a new callback control, sets the adapter to * TActiveControlAdapter. If you override this class, be sure to set the @@ -47,10 +50,9 @@ class TJuiSortable extends TActivePanel implements IJuiOptions, ICallbackEventHa */ public function getOptions() { - static $options; - if($options===null) - $options=new TJuiControlOptions($this); - return $options; + if($this->_options===null) + $this->_options=new TJuiControlOptions($this); + return $this->_options; } /** @@ -62,6 +64,15 @@ class TJuiSortable extends TActivePanel implements IJuiOptions, ICallbackEventHa return array('appendTo', 'axis', 'cancel', 'connectWith', 'containment', 'cursor', 'cursorAt', 'delay', 'disabled', 'distance', 'dropOnEmpty', 'forceHelperSize', 'forcePlaceholderSize', 'grid', 'handle', 'helper', 'items', 'opacity', 'placeholder', 'revert', 'scroll', 'scrollSensitivity', 'scrollSpeed', 'tolerance', 'zIndex'); } + /** + * Array containing valid javascript events + * @return array() + */ + public function getValidEvents() + { + return array('activate', 'beforeStop', 'change', 'create', 'deactivate', 'out', 'over', 'receive', 'remove', 'sort', 'start', 'stop', 'update'); + } + /** * @return array list of callback options. */ -- cgit v1.2.3