Skip to content

Commit eb8ea39

Browse files
committed
993 - Added TDatePicker::DropDownCssClass to apply a class to all the dropdowns
1 parent b3f1b01 commit eb8ea39

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Version 4.3.x - TBD
2+
3+
ENH: Issue #993 - Added TDatePicker::DropDownCssClass to apply a class to all the dropdowns
4+
15
## Version 4.3.0 - October 26, 2023
26

37
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)

framework/Web/UI/WebControls/TDatePicker.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,22 @@ public function getCalendarStyle()
215215
return $this->getViewState('CalendarStyle', 'default');
216216
}
217217

218+
/**
219+
* @param string $value Additional Css class name applied to dropdowns in DropDownList mode.
220+
*/
221+
public function setDropDownCssClass($value)
222+
{
223+
$this->setViewState('DropDownCssClass', $value);
224+
}
225+
226+
/**
227+
* @return string Additional Css class name applied to dropdowns in DropDownList mode.
228+
*/
229+
public function getDropDownCssClass()
230+
{
231+
return $this->getViewState('DropDownCssClass');
232+
}
233+
218234
/**
219235
* Set the first day of week, with 0 as Sunday, 1 as Monday, etc.
220236
* @param int $value 0 for Sunday, 1 for Monday, 2 for Tuesday, etc.
@@ -702,7 +718,7 @@ protected function renderCalendarDayOptions($writer, $selected = null)
702718
$days = $this->getDropDownDayOptions();
703719
$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'day');
704720
$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'day');
705-
$writer->addAttribute('class', 'datepicker_day_options');
721+
$writer->addAttribute('class', 'datepicker_day_options ' . $this->getDropDownCssClass());
706722
if ($this->getReadOnly() || !$this->getEnabled(true)) {
707723
$writer->addAttribute('disabled', 'disabled');
708724
}
@@ -735,7 +751,7 @@ protected function renderCalendarMonthOptions($writer, $selected = null)
735751
$info = $this->getLocalizedCalendarInfo();
736752
$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'month');
737753
$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'month');
738-
$writer->addAttribute('class', 'datepicker_month_options');
754+
$writer->addAttribute('class', 'datepicker_month_options ' . $this->getDropDownCssClass());
739755
if ($this->getReadOnly() || !$this->getEnabled(true)) {
740756
$writer->addAttribute('disabled', 'disabled');
741757
}
@@ -790,7 +806,7 @@ protected function renderCalendarYearOptions($writer, $selected = null)
790806
}
791807
$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'year');
792808
$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'year');
793-
$writer->addAttribute('class', 'datepicker_year_options');
809+
$writer->addAttribute('class', 'datepicker_year_options ' . $this->getDropDownCssClass());
794810
if ($this->getReadOnly() || !$this->getEnabled(true)) {
795811
$writer->addAttribute('disabled', 'disabled');
796812
}

0 commit comments

Comments
 (0)