summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TDatePicker.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TDatePicker.php')
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 2f9758d1..1dabb7ce 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -407,6 +407,7 @@ class TDatePicker extends TTextBox
$page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'year');
}
$this->publishCalendarStyle();
+ $this->registerCalendarClientScriptPre();
}
/**
@@ -427,7 +428,7 @@ class TDatePicker extends TTextBox
$this->renderDropDownListCalendar($writer);
if($this->hasDayPattern())
{
- $this->registerCalendarClientScript();
+ $this->registerCalendarClientScriptPost();
$this->renderDatePickerButtons($writer);
}
}
@@ -840,20 +841,27 @@ class TDatePicker extends TTextBox
{
parent::addAttributesToRender($writer);
$writer->addAttribute('id',$this->getClientID());
- $this->registerCalendarClientScript();
+ $this->registerCalendarClientScriptPost();
}
/**
* Registers the javascript code to initialize the date picker.
*/
- protected function registerCalendarClientScript()
+ protected function registerCalendarClientScriptPre()
{
if($this->getShowCalendar())
{
$cs = $this->getPage()->getClientScript();
$cs->registerPradoScript("datepicker");
+ }
+ }
+ protected function registerCalendarClientScriptPost()
+ {
+ if($this->getShowCalendar())
+ {
+ $cs = $this->getPage()->getClientScript();
if(!$cs->isEndScriptRegistered('TDatePicker.spacer'))
{
$spacer = $this->getAssetUrl('spacer.gif');