Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Remove GetQvObject callback for input boxes etc

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 ?

Labels (2)
2 Replies
Not applicable
Author

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.

Not applicable
Author

Could you write code to solve this problem? thank you