From 8f421e464e357dbf982cb8537dcf2fb8335e086c Mon Sep 17 00:00:00 2001 From: "Victor Lavaud (qdii)" Date: Sun, 1 Mar 2015 11:21:08 +0100 Subject: [PATCH] new members eventRender and eventAfterRender permit specifying the JS rendering callbacks --- yii2fullcalendar.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/yii2fullcalendar.php b/yii2fullcalendar.php index 6b51c5f..866dea3 100644 --- a/yii2fullcalendar.php +++ b/yii2fullcalendar.php @@ -86,6 +86,18 @@ class yii2fullcalendar extends elWidget */ private $_pluginName = 'fullCalendar'; + /** + * The javascript function to us as en eventRender callback + * @var string the javascript code that implements the eventRender function + */ + public $eventRender = ""; + + /** + * The javascript function to us as en eventAfterRender callback + * @var string the javascript code that implements the eventAfterRender function + */ + public $eventAfterRender = ""; + /** * Initializes the widget. * If you override this method, make sure you call the parent implementation first. @@ -181,6 +193,12 @@ protected function getClientOptions() $options['loading'] = new JsExpression("function(isLoading, view ) { $('#{$id}').find('.fc-loading').toggle(isLoading); }"); + if ($this->eventRender){ + $options['eventRender'] = new JsExpression($this->eventRender); + } + if ($this->eventAfterRender){ + $options['eventAfterRender'] = new JsExpression($this->eventAfterRender); + } $options = array_merge($options, $this->clientOptions); return Json::encode($options); }