Skip to main content Skip to complementary content

selectValues method

selectValues(dimNo, values, toggleMode)

Method used to Select values in this object. This will activate the selection toolbar and look to the user like a standard Qlik Sense select.

If you instead want the selections to be sent to the Engine right away, use the selectValues method in the backendApi, which has the same parameters.

Tip noteRefer to Horizontal list for an example that shows both ways of making selections.

Parameters

Name Type Description
dimNo Number Dimension number (ignored if listbox)
values Array Array of values to select
toggleMode Boolean

If true, values in the field are selected in addition to any previously selected items.

If false, values in the field are selected while previously selected items are deselected.

Example

$element.find('li').on('qv-activate', function() { if(this.hasAttribute("data-value")) { var value = parseInt(this.getAttribute("data-value"), 10), dim = 0; self.selectValues(dim, [value], true); } });

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!