Last active
August 29, 2015 14:19
-
-
Save marvinosswald/e7e2088241be1e158dec to your computer and use it in GitHub Desktop.
Can't access jquery obj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from "ember"; | |
export default Ember.Component.extend({ | |
attributeBindings: ['id'], | |
id: 'calendar', | |
setEvents:function (){ | |
var events = this.get("theEvents"); | |
var arr = [] | |
events.forEach(function(e,i,enumerable){ | |
arr.push({ | |
id: e.get('id'), | |
title: e.get('title'), | |
start: e.get('start'), | |
color: e.get('color'), | |
allDay: true | |
}) | |
}); | |
console.log({events:arr}); | |
$('#calendar').fullCalendar('addEventSource',{events:arr}); //this.$() doesn't work as well | |
}.observes("theEvents.content","theEvents.isFulfilled").on('init'), | |
_initializeCalendar: function() { | |
var self = this; | |
$("#calendar").fullCalendar({ //can't use this.$() here as well... | |
lang: 'de', | |
header: { | |
left: 'prev,next today', | |
center: 'title', | |
right: 'month,agendaWeek,agendaDay' | |
}, | |
weekends: false, | |
dayClick: function(date) { | |
self.sendAction("dayClick",date); | |
}, | |
}); | |
}.on('didInsertElement') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment