$.Controller("Whiteboard", {}, {
init: function(){
var pen = new Pen();
},
sendRequest: function() {
// This function should listen draw/erasing events from Pen
}
});
$.Class("Pen",{},{
init: function() {
// Pen setup, click to draw etc..
}
});
Something like this, I want the Whiteboard listen events from Pen, how can I do this? I need Controller listen on a Class.
If this is JMVC 3.2+ you can do something like this:
For JMVC 3.1, you'll have to use
$.Model
instead of$.Observe
and usethis.bind
in your controller like this: