Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FullCalendar with Ember and Twitter Bootstrap

I implemented a FullCalendar in a Twitter Bootstrap Tab in a JS application written in Ember. The contents of the tab has the following Handlebars in it.

<div class="container-fluid">
    <div class="row-fluid">
        <div class="commands pull-left">
            <input type="text" placeholder="Display Calendar for" data-provide="typeahead">
        </div>
        <div class="commands pull-right">
            <a {{bindAttr class=":btn :btn-primary"}} href="#" {{action "newEvent"}}><i class="icon-plus icon-white"></i> Add Event</a>
        </div>
    </div>
    <hr/>
    <div class="row-fluid">
        {{#view App.CalendarTool id="calendar" class="calendar"}}
        {{/view}}
    </div>
</div>

The class App.CalendarTool is defined as follows:

require('fullcalendar/fullcalendar');
require('fullcalendar/gcal');

App.CalendarTool = Em.View.extend({
    tagName:'div',
    attributeBindings:['id','events','owner'],
    classNamesBindings:['class'],
    didInsertElement:function(){

        this.$().fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay '
            },
            editable: true,
            events: []
        });

    }

});

When the page loads, the fullcalendar is not coming up. Only buttons in the top are coming up. When I press today, the fullcalendar is showing up.

JSFIddle - http://jsfiddle.net/uMVyu/

like image 381
Roney Banerjee Avatar asked Jul 30 '12 05:07

Roney Banerjee


1 Answers

http://jsfiddle.net/uMVyu/1/

Solved with FullCalendar Render on tab click.

like image 75
Roney Banerjee Avatar answered Oct 23 '22 00:10

Roney Banerjee