Hi!
I’m trying to call a method from my onClick function like this:
scheduler.attachEvent("onClick", function (id, e){
console.log("id: ", id);
this.callingMethod(id);
console.log("method called");
return false;
});
But when I do this, it doesn’t work, it only prints “id” and the method never gets called, even if the method it’s a simple console.log like this:
callingMethod(id){
console.log("id",id);
}
I need to do this because that method it’s supposed to trigger an action that will open a little window with the event information.
Another thing that happens is that when I define a variable for the class for example:
tasks = information about tasks
then when I print it before the onClick function it gives the information stored in the variable, but when I do it inside the function:
scheduler.attachEvent("onClick", function (id, e){
console.log("id", id);
console.log("this.tasks", this.tasks);
return false;
});
it prints undefined.
Why is this all happening?