Qlik Community

Integration, Extension & APIs

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

Announcements
Qlik Insider: SaaS capabilities for Data Integration and Analytics, May 25th! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
bernhard2760
Partner
Partner

Button clik selection does not work

Dear Community,

 

I have created a simple code for a button qlik selection that does not work.

 

Does anyone know what I did worng:

HTML:

<div id="ListYear" class="btn-group col-lg-9" style="height: 30px; margin-top: 20px;"></div>

JS:

//callbacks -- inserted here --
function ListYear(reply, app){
$("#ListYear").empty();
var qObject = reply.qListObject;

//Loop through the data returned
$.each(qObject.qDataPages[0].qMatrix, function(){
//get current item
var item = this[0];
var selT = "";
//Check to see if it's selected, if so, set the list item to bold
if(item.qState =="S"){
selT = " style=\"background-color: darkblue;\"";
}
//append the item to the list
$("#ListYear").append("<button type=\"checkbox\"" + selT + "class=\"btn btn-primary pull-right\">" + item.qText + "</button>");
});
//if user click on the button make a selection
$("#ListYear button").click(function(){
app.field('Year').selectMatch($(this).text(),false);
});
}

 

Kind regards

Bernhard

Labels (3)
2 Replies
Anil_Babu_Samineni

Are you trying this via Widget or ?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
bernhard2760
Partner
Partner
Author

no I am using it as a mashup. I get an error that text() is not defined.

console.log(text).png