From cda44920115f2aadd7c3fbe2df13cb48a2cbc0c5 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sat, 25 Jun 2011 09:08:40 +0000 Subject: applied further "progressive rendering" patches (#235) added TFlushOutput component fixed THtmlarea quickstart demo --- framework/Web/UI/WebControls/TDatePicker.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/WebControls/TDatePicker.php') 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'); -- cgit v1.2.3