Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I cannot figure out how to remove a callback function that i have set. I want the callback to be triggered one time and then removed.
I add the callback like this:
var VarCallback = function (){
this.SetVariable( "0", 0); // how do we remove call to this callback function? it is called every time the variable is updated!
}
function CloseFavourite(inputBoxId){
pek = _pek1;
var inputbox = pek.GetQvObject( inputBoxId, VarCallback);
}
This works but the problem is that VarCallback() gets called every time the variable in inputBoxId gets updated.
Is there a way to remove callbacks assigned using GetQvObject ?
Bonus points: can a callback function be removed that was assigned using Qva.AddExtension ?
I fixed the callback problem using a variable within a closure around the callback. I still am curious if there is an easy way to remove a callback though. Hopefully without modifying prototype.
Could you write code to solve this problem? thank you