I'm not sure what the best way to approach this is.
I have a control that I want to be able to open and persist some data or change it on the fly.
function TaskControl(params) {
this.params = params;
this.openTaskControl = function () {
alert("openTaskControl");
}
$("#button").click(function () {
this.openTaskControl();
});
}
The problem I'm having is that trying to call openTaskControl throws an error because this
apparently refers to the HTML element and not the TaskControl. How do I call this function from inside the click function?