Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
rbartley
Not applicable

Qlik Sense Mashups - event for responding to selections

Hello all,

What is the best way of picking up when a change has been made to a QS filter panel element?  Is it to simply use the $("#FilterPanelID").change() event?  Is there any way of referring to individual elements within a filter panel?


Thanks in advance.


Richard

1 Solution

Accepted Solutions
erik_wetterberg
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Yes, that's the one.It will be called whenever the field changes with the current selection state.

Hope this helps

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
8 Replies
erik_wetterberg
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Hi Richard,

Do you really want to listen to selection made just in the filter panel, not through for example the selection toolbar, a chart or with a bookmark? In that case you probably need some reverse engineering och the filter panel.

If you want to listen to all selection made in a specificerat field, you can use the createList method: createList method ‒ Qlik Sense.

Hope this helps

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
rbartley
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Hello Erik,

Thank you for replying.   Unfortunately, the Qlik Help page did not provide any examples of how this would work.  Are you suggesting that if I add a filter panel and also create lists for each of the fields contianed within the filter panel then I can somehow check for an onchange event?  I would be grateful if you could provide a small example.

Richard

erik_wetterberg
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Hi,

I suggestiv you create a list, pretty much like the code example in the helps, for each field you want to listen to changes for. Every time there is a change in selection that affect this field your callback funktion will be called.

Hope this helps

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
rbartley
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Thanks again Erik.  When talking about the callback function are you referring to the anonymous function that begins on line 12 below?app.createList({

  "qDef": {

  "qFieldDefs": [

  "[Year]"

  ]

  },

  "qInitialDataFetch": [{

  qTop : 0,

  qLeft : 0,

  qHeight : 40,

  qWidth : 1

  }]

  }, function(reply) {

  var str = "";

  $.each(reply.qListObject.qDataPages[0].qMatrix, function(key, value) {

  str += '<li>' + value[0].qText + '</li>';

  });

  $('#list').html(str);

  ;

  });

erik_wetterberg
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Yes, that's the one.It will be called whenever the field changes with the current selection state.

Hope this helps

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
rbartley
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Yes, that seems to work.  I assume that i can determine which items are selected by looking at selections from qSelectionInfo, right?

erik_wetterberg
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Not really, I'm afraid. You should look at qState in the cells, documented as NxCell here:ListObject ‒ Qlik Sense. There is also a count of # of values in the different state in qDimensionInfo: NxDimensionInfo ‒ Qlik Sense

Hope this helps

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
rbartley
Not applicable

Re: Qlik Sense Mashups - event for responding to selections

Yes, I'd spotted that while looking at qMatrix, but thought that there might be a shortcut to having to loop through all of the values.  Oh well, never mind.  Thank you very much for your help.