Skip to content

Commit

Permalink
Merge pull request #48 from cicsolutions/master
Browse files Browse the repository at this point in the history
Enhancement for using yii2fullcalendar with pjax
  • Loading branch information
philippfrenzel committed Apr 23, 2016
2 parents d5544c6 + 675fac3 commit a008626
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions yii2fullcalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ protected function registerPlugin()
} else {
$this->clientOptions['header'] = $this->header;
}

// clear existing calendar display before rendering new fullcalendar instance
// this step is important when using the fullcalendar widget with pjax
$js[] = "var loading_container = jQuery('#$id .fc-loading');"; // take backup of loading container
$js[] = "jQuery('#$id').empty().append(loading_container);"; // remove/empty the calendar container and append loading container bakup

$cleanOptions = $this->getClientOptions();
$js[] = "jQuery('#$id').fullCalendar($cleanOptions);";
Expand Down

0 comments on commit a008626

Please sign in to comment.