diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-01-10 16:24:53 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2014-01-10 16:24:53 +0100 |
commit | 1f7c124858073c35ed4f753e84495e9bebd25cfc (patch) | |
tree | ded342c913449f52b4a798bad088648ef410635a /framework | |
parent | 91c664a088cf9177b8c6ca27d9c1ada88476b304 (diff) |
Fixed AutoPostback of TImageButton, TCheckBoxList, TRadioButtonList
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/Javascripts/source/prado/controls/controls.js | 30 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TCheckBoxList.php | 2 |
2 files changed, 15 insertions, 17 deletions
diff --git a/framework/Web/Javascripts/source/prado/controls/controls.js b/framework/Web/Javascripts/source/prado/controls/controls.js index fa01e2e2..00a39e66 100644 --- a/framework/Web/Javascripts/source/prado/controls/controls.js +++ b/framework/Web/Javascripts/source/prado/controls/controls.js @@ -290,11 +290,11 @@ Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl, * Override parent onPostBack function, tried to add hidden forms * inputs to capture x,y clicked point. */ - onPostBack : function(event, options) + onPostBack : function(options, event) { - this.addXYInput(event,options); - new Prado.PostBack(event, options); - this.removeXYInput(event,options); + this.addXYInput(options, event); + new Prado.PostBack(options, event); + this.removeXYInput(options, event); }, /** @@ -302,7 +302,7 @@ Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl, * @param event DOM click event. * @param array image button options. */ - addXYInput : function(event,options) + addXYInput : function(options, event) { var imagePos = jQuery(this.element).offset(); var clickedPos = [event.clientX, event.clientY]; @@ -335,7 +335,7 @@ Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl, * @param event DOM click event. * @param array image button options. */ - removeXYInput : function(event,options) + removeXYInput : function(options, event) { var id = this.element.id; jQuery('#'+id+'_x').remove(); @@ -496,16 +496,15 @@ jQuery.klass(Prado.WebUI.TTextHighlighter, Prado.WebUI.TCheckBoxList = jQuery.klass(Prado.WebUI.Control, { - constructor : function(options) + onInit : function(options) { - Prado.Registry.set(options.ListID, this); for(var i = 0; i<options.ItemCount; i++) { - var checkBoxOptions = jQuery.extend( + var checkBoxOptions = jQuery.extend({}, options, { - ID : options.ListID+"_c"+i, + ID : options.ID+"_c"+i, EventTarget : options.ListName+"$c"+i - }, options); + }); new Prado.WebUI.TCheckBox(checkBoxOptions); } } @@ -513,16 +512,15 @@ Prado.WebUI.TCheckBoxList = jQuery.klass(Prado.WebUI.Control, Prado.WebUI.TRadioButtonList = jQuery.klass(Prado.WebUI.Control, { - constructor : function(options) + onInit : function(options) { - Prado.Registry.set(options.ListID, this); for(var i = 0; i<options.ItemCount; i++) { - var radioButtonOptions = jQuery.extend( + var radioButtonOptions = jQuery.extend({}, options, { - ID : options.ListID+"_c"+i, + ID : options.ID+"_c"+i, EventTarget : options.ListName+"$c"+i - }, options); + }); new Prado.WebUI.TRadioButton(radioButtonOptions); } } diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php index af59545c..16e6b7f5 100644 --- a/framework/Web/UI/WebControls/TCheckBoxList.php +++ b/framework/Web/UI/WebControls/TCheckBoxList.php @@ -489,7 +489,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont */ protected function getPostBackOptions() { - $options['ListID'] = $this->getClientID(); + $options['ID'] = $this->getClientID(); $options['ValidationGroup'] = $this->getValidationGroup(); $options['CausesValidation'] = $this->getCausesValidation(); $options['ListName'] = $this->getUniqueID(); |