ember.js - How do I send a object into the Jquery $('calendar') selector from outside -
in below code, in didinsertelement, want send mycontroller object in jquery selector ('#calendar').how can this. possible this. might easy. 1 please
(function () { app.eventdisplaycalendardisplayview = ember.view.extend({ didinsertelement: function () { //i got controller object here, want pass in jquery calendar selector below. // how var mycontroller = this.get('controller'); $('#calendar').fullcalendar({ weekends: true, events: this.get('controller'), dayclick: function(start, allday, jsevent, view) { //i want access controller here how this. var controller = mycontroller; //this not work. }, eventlimit: true, // non-agenda views views: { agenda: { eventlimit: 6 // adjust 6 agendaweek/agendaday } }, eventclick: function(xevent, jsevent, view) { debugger; alert("title: " + xevent.title //get event title + "\n starttime: " + xevent.start //get event start date + "\n endtime: " + xevent.end //get event end date ); console.log(xevent); //see console event properties/objects } }); }, willdestroyelement: function () { } }); }());
look calling function .bind(variable)
: https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/function/bind
Comments
Post a Comment