From f10e112d93d9453276b496cd80a6b359d0f82f09 Mon Sep 17 00:00:00 2001
From: ctrlaltca <>
Date: Sat, 7 Jul 2012 09:29:38 +0000
Subject: fix #413
---
.../Web/UI/ActiveControls/TActiveDatePicker.php | 54 ++++++++++++++++++----
1 file changed, 45 insertions(+), 9 deletions(-)
(limited to 'framework/Web/UI/ActiveControls')
diff --git a/framework/Web/UI/ActiveControls/TActiveDatePicker.php b/framework/Web/UI/ActiveControls/TActiveDatePicker.php
index d7b643ed..d3105d09 100755
--- a/framework/Web/UI/ActiveControls/TActiveDatePicker.php
+++ b/framework/Web/UI/ActiveControls/TActiveDatePicker.php
@@ -86,14 +86,6 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I
return $this->getAdapter()->getBaseActiveControl();
}
- /**
- * @return TCallbackClientSide client side request options.
- */
- public function getClientSide()
- {
- return $this->getAdapter()->getBaseActiveControl()->getClientSide();
- }
-
/**
* Client-side Text property can only be updated after the OnLoad stage.
* @param string text content for the textbox
@@ -161,5 +153,49 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I
$code = "new Prado.WebUI.TActiveDatePicker($options);";
$cs->registerEndScript("prado:".$this->getClientID(), $code);
}
+
+ /**
+ * @return TActiveDatePickerClientScript javascript validator event options.
+ */
+ protected function createClientScript()
+ {
+ return new TActiveDatePickerClientScript;
+ }
}
-?>
+
+/**
+ * TActiveDatePickerClientScript class.
+ *
+ * Client-side date picker event {@link setOnDateChanged OnDateChanged}
+ * can be modified through the {@link TActiveDatePicker::getClientSide ClientSide}
+ * property of a date picker.
+ *
+ * The OnDateChanged event is raise when the date picker's date
+ * is changed.
+ * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
+ * as parameter to this event
+ *
+ * @author Fabio Bas
+ * @version $Id$
+ * @package System.Web.UI.ActiveControls
+ * @since 3.2.1
+ */
+class TActiveDatePickerClientScript extends TCallbackClientSide
+{
+ /**
+ * Javascript code to execute when the date picker's date is changed.
+ * @param string javascript code
+ */
+ public function setOnDateChanged($javascript)
+ {
+ $this->setFunction('OnDateChanged', $javascript);
+ }
+
+ /**
+ * @return string javascript code to execute when the date picker's date is changed.
+ */
+ public function getOnDateChanged()
+ {
+ return $this->getOption('OnDateChanged');
+ }
+}
\ No newline at end of file
--
cgit v1.2.3