Hi, This might be a javascript thing, but I'm not able to figure out.. I have a custom function defined with in the view and I want to call that function on click of a button (I have added it as part of the onselect listener definition in the create view function). When I click on the button I get the error "TypeError: this.testfunc is not a function".
If I call the same function from updateView it works just fine.. I'm doing some thing wrong..but not sure what it is... here is a stripped down version of my code.. it basically has a button defined inside create view and the event listener definitions for the button and a dummy updateView and testfunc (my custom function).
If I call the same function from updateView it works just fine.. I'm doing some thing wrong..but not sure what it is... here is a stripped down version of my code.. it basically has a button defined inside create view and the event listener definitions for the button and a dummy updateView and testfunc (my custom function).
var TestView = new KONtx.Class({
ClassName: 'TestView',
Extends: KONtx.system.SidebarView,
createView: function() {
var regbutton = new KONtx.control.TextButton({
label: "Complete",
guid: "button0",
events: {
onSelect: function(event) {
this.testfunc(); //This returns the error : TypeError: this.testfunc is not a function".
},
},
}).appendTo(this); //end of regbutton
}, //End of create view
updateView: function() {
this.parent();
this.testfunc();
}, //End of update view.
testfunc: function() {
print(" ********************************** Test Func called ");
}, //End of test func
});
