diff --git a/HISTORY.md b/HISTORY.md index b857adff3..c1cee2de2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +## Version 4.3.x - TBD + +ENH: Issue #993 - Added TDatePicker::DropDownCssClass to apply a class to all the dropdowns + ## Version 4.3.0 - October 26, 2023 ENH: Issues #824, #838, #851, #891, #910, #917 - General Behaviors Update: Cloning and Serializing supports behaviors. IBaseBehavior has init($config) method. TClassBehavior tracks their owners. Behaviors attach their registered event handlers at the behavior priority. Registered Behavior event can optionally attached and detached automatically when the behavior is enabled or disabled (default). Behavior events() support Closures. IBehavior are attachable class-wide by cloning. Behaviors for behaviors has better support. Behaviors are case insensitive. Supports Anonymous (unnamed/numeric) behaviors. Wakeup updates the component behaviors with new named class behaviors. (belisoful) diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php index 9ce4a4f47..641d6a07a 100644 --- a/framework/Web/UI/WebControls/TDatePicker.php +++ b/framework/Web/UI/WebControls/TDatePicker.php @@ -215,6 +215,22 @@ public function getCalendarStyle() return $this->getViewState('CalendarStyle', 'default'); } + /** + * @param string $value Additional Css class name applied to dropdowns in DropDownList mode. + */ + public function setDropDownCssClass($value) + { + $this->setViewState('DropDownCssClass', $value); + } + + /** + * @return string Additional Css class name applied to dropdowns in DropDownList mode. + */ + public function getDropDownCssClass() + { + return $this->getViewState('DropDownCssClass'); + } + /** * Set the first day of week, with 0 as Sunday, 1 as Monday, etc. * @param int $value 0 for Sunday, 1 for Monday, 2 for Tuesday, etc. @@ -702,7 +718,7 @@ protected function renderCalendarDayOptions($writer, $selected = null) $days = $this->getDropDownDayOptions(); $writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'day'); $writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'day'); - $writer->addAttribute('class', 'datepicker_day_options'); + $writer->addAttribute('class', 'datepicker_day_options ' . $this->getDropDownCssClass()); if ($this->getReadOnly() || !$this->getEnabled(true)) { $writer->addAttribute('disabled', 'disabled'); } @@ -735,7 +751,7 @@ protected function renderCalendarMonthOptions($writer, $selected = null) $info = $this->getLocalizedCalendarInfo(); $writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'month'); $writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'month'); - $writer->addAttribute('class', 'datepicker_month_options'); + $writer->addAttribute('class', 'datepicker_month_options ' . $this->getDropDownCssClass()); if ($this->getReadOnly() || !$this->getEnabled(true)) { $writer->addAttribute('disabled', 'disabled'); } @@ -790,7 +806,7 @@ protected function renderCalendarYearOptions($writer, $selected = null) } $writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'year'); $writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'year'); - $writer->addAttribute('class', 'datepicker_year_options'); + $writer->addAttribute('class', 'datepicker_year_options ' . $this->getDropDownCssClass()); if ($this->getReadOnly() || !$this->getEnabled(true)) { $writer->addAttribute('disabled', 'disabled'); }