How to get Variable value when building the mashup
I recently have a question regarding how to obtain the variable value via the api in mashup.
I created an simply app, with one variable input to toggle different charts, and a half year filter, and then a show/hide container as below screenshot show.
And then created the mashup with these 3 objects
My requirement is when "Viz 1" is selected, the"Half Year" filter should be displayed, while "Viz 2" is selected, it should be hide, I mean the <div> should be hide so that the chart for "Viz 2" should move up, just under the variable input. (I have tried the show/hide container, the problem is when I bring it to mashup, it holds the place even when the filter is hided)
I tried the qlik.app.variable.getContent() method, but it seems not returning the value properly when click the different buttons, so that the Viz 2 chart isn't moving up when the variable is set it to "Viz 2". Is there anyone help with this? Thx
I attached the .qvf and below are the Html and js code.
//callbacks -- inserted here -- //open apps -- inserted here -- var app = qlik.openApp('case1.qvf', config);// open the app app.getObject('CurrentSelections','CurrentSelections'); //get objects -- inserted here -- app.getObject('QV01','tBypm'); app.getObject('QV02','eYZhEJT'); app.getObject('QV03','fPjMCJe');