I would like to get help solving a problem with this code: I'm developing a Qlik sense Extension using JavaScript. I Write the function GetCurrSelect , And I want it to run only when I call it from the paint function. But every time the program needs to run the paint function, it first run the GetCurrSelect function and even several times. I tried to add the condition if(a===1) But it did not help, the program accesses this function even without invoke it.
This is my code:
define(["jquery", "qlik", "text!./Network_Diagram.css","./d3.min"], function($ , qlik, cssContent) {'use strict';
$("<style>").html(cssContent).appendTo("head");
qlikG=qlik.currApp();
function GetCurrSelect(a){
if(a===1)
{
try{
qlikG.getList('SelectionObject', function(reply){
alert("here!");
});
}
catch(err){
currSelectionNum=0;
}
}
}
return {
//....
paint : function($element,layout) {
GetCurrSelect(1);
}
//....