Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm working on a sense mockup where i use customized action buttons.
in my .js file i've written like the example below. The clearAll button works fine, but not the selectValues. (with this I want to select a specific value in a specific field)
Any one has an idea of what could be wrong?
...
var app1 = qlik.openApp('Mikrosegment.qvf', config);
$('#clear').on('click', function(event) { |
event.preventDefault();
app1.clearAll();
});
$('#Q4').on('click', function() { |
app1.field('kvartal').selectValues([{qText:"Q4"}], true, true); |
});
Thanks!
/Pierre
Ok,
Now it works kind of auto magical. Seems like it had to be double quotation marks when calling field (id) and selectValues. I'ts the little tiny things that does it! *sigh*
This is a great function allowing you to select and monitor your mockup app in any direction with the design you want
Works great as Div, P, A href, Button... So, no extra extension needed!
HTML:
<div id="mainSegA" class="btn btn-default">Main Segment A</div>
.js:
$("#mainSegA").click(function() {
app1.field("Main segment").selectValues([{qText:"A"}], true, true);
});
Hi Pierre,
If 'kvartal' is a numeric field you need the numeric value. Try something like:
app1.field('kvartal').selectValues([4], true, true);
or perhaps
app1.field('kvartal').selectValues([3], true, true);
Erik
unfortunately it is a string...
/Pierre
Have you tried to debug this?? Does it manage to find the field (that is does app1.field("kvartal") return a field object)??
Erik
Ok,
Now it works kind of auto magical. Seems like it had to be double quotation marks when calling field (id) and selectValues. I'ts the little tiny things that does it! *sigh*
This is a great function allowing you to select and monitor your mockup app in any direction with the design you want
Works great as Div, P, A href, Button... So, no extra extension needed!
HTML:
<div id="mainSegA" class="btn btn-default">Main Segment A</div>
.js:
$("#mainSegA").click(function() {
app1.field("Main segment").selectValues([{qText:"A"}], true, true);
});
guys, do you have an idea what is the syntax in .selectValues method to have a selection based on a formula, not based on a list of constants (field members), something like
myField.selectValues(["=Country LIKE 'A*'"], true, true);
The engine is able to handle this and even the user may enter this in the search icon popup of each listbox.