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/
http://jsfiddle.net/uMVyu/1/
Solved with FullCalendar Render on tab click.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With