1

Yet another question about the angular calendar directive. I need to display multiple calendars on one page and am using the jquery tabs widget. However, only one calendar will render properly. In normal jquery fullCalendar, you use the 'render' method to ensure that the calendar shows when the tab is selected. However, this doesn't seem to be working with the angular-ui calendar directive.

Here is a plunker showing what I mean. Delete the $().tabs() and the three angular calendars display just fine. Wrap them in tabs, and it no longer works:

http://plnkr.co/edit/HEEX4iqb8kFAsjwdGmkM

Any ideas on why this is not working and how to fix it?

Thanks!

PS. I will cross-post this question in Google Groups. Thanks.

2 Answers 2

1

It appears that despite the fullCalendar documentation, "show" is not the place to trigger a fullcalendar('render'). I should say, at least not when working with Angular. I don't know if that is correct under normal jQuery usage. Use the "Activate" event instead:

$("#tabs").tabs({
  activate: function(){
    ("#calendar").fullCalendar('render');
  }
});

http://plnkr.co/edit/HEEX4iqb8kFAsjwdGmkM

Sign up to request clarification or add additional context in comments.

1 Comment

Personally I would advocate using ui-event="active:'whatever()'}instead. We should probably also add a ui-refresh property to the calendar directive too. Feel free to open a bug ticket for the latter.
0

Use timeout while rendering.

<tab heading="{{tabs[0].title}}" active="tabs[0].active" select="renderCalendar()" disabled="tabs[0].disabled">


     $scope.renderCalendar = function() {
               $timeout(function(){
                    $('.calendar').fullCalendar('render');
                }, 0);
        };

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.