From 1f38c2ebd86df1ff47aabe4b39c3c213c9d848c3 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 16 Jun 2016 02:38:11 +0200 Subject: * optional grouped/normal display in calendar grid --- app/frontend/controls/CalendarGrid.php | 14 ++++++++++++++ app/frontend/controls/CalendarGrid.tpl | 20 ++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) (limited to 'app') diff --git a/app/frontend/controls/CalendarGrid.php b/app/frontend/controls/CalendarGrid.php index 4ebfacd..b168379 100644 --- a/app/frontend/controls/CalendarGrid.php +++ b/app/frontend/controls/CalendarGrid.php @@ -54,6 +54,20 @@ class CalendarGrid extends FacadeTemplateControl { $param->Item->Events->dataBind(); } + public function eventCreate($sender, $param) { + if (preg_match('/Item$/', $param->Item->ItemType)) { + $renderer = 'Dummy'; + if ($param->Item->Data) { + $renderer = $param->Item->Data->getRendererClass(); + } + $eventTemplate = Prado::createComponent( + 'Application.controls.grid.' . $renderer . 'GridElement' + ); + $eventTemplate->setData($param->Item->Data); + $param->Item->addParsedObject($eventTemplate); + } + } + } ?> diff --git a/app/frontend/controls/CalendarGrid.tpl b/app/frontend/controls/CalendarGrid.tpl index 2b3ada8..37ee81a 100644 --- a/app/frontend/controls/CalendarGrid.tpl +++ b/app/frontend/controls/CalendarGrid.tpl @@ -1,23 +1,15 @@ - +
- +
<%# $this->Data->Date %> - + - - - - gridEvent <%# $this->Parent->Parent->Data->Date == $this->Data->DateFrom ? 'beginDate' : '' %> <%# $this->Parent->Parent->Data->Date == $this->Data->DateTo ? 'endDate' : '' %> - <%# $this->Data->Name %> - - - -
 
-
-
-- cgit v1.2.3