Skip to content

Commit

Permalink
new members eventRender and eventAfterRender permit specifying the JS…
Browse files Browse the repository at this point in the history
… rendering callbacks
  • Loading branch information
qdii committed Mar 1, 2015
1 parent 4d10ea9 commit 8f421e4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions yii2fullcalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 8f421e4

Please sign in to comment.