Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
noa_elharrar
Contributor
Contributor

Qlik Sense Extension getList('SelectionObject')

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);
         }
     //....

Thank you!

Labels (1)
0 Replies