Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Qlik Sense extension :
I can set new selection like this ..
self.backendApi.selectValues(dim, [value], true); // this simply add new selection to array
But before doing that I want to clear all selections ..
self.backendApi.clearSelections(); // tried this but its not working ..
Some how I cant clear selections ? I just want one selection to be active
Found the solution thanks to Andre Ferreira
create dependency "qlik"
and then you can call following to clear all selections .
qlik.currApp().clearAll();
Adeel,
Look into the ClearAll method in the Engine API
http://help.qlik.com/sense/en-us/developer/#../Subsystems/Qlik_Engine_API/Content/Classes/App class/AppClassClearAllMethod.htm
Found the solution thanks to Andre Ferreira
create dependency "qlik"
and then you can call following to clear all selections .
qlik.currApp().clearAll();
Hi Adeel,
The last parameter in the selectValues method is just for that. Check out:http://help.qlik.com/sense/en-us/developer/#../Subsystems/Workbench/Content/BuildingExtensions/API/b...
qToggleMode | 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. |
so perhaps self.backendApi.selectValues(dim, [value], false); is what you need.
Many thanks Erik .. it was very helpful ..
Just to add to this answer, setting the third parameter to true, as such:
backendApi.selectValues(dim, [value], true);
Will not only add any new selections made to previously selected items, but also will de-select/unselect any selections made that are already in the current selection. i.e. when set to true, if the user clicks on an item that is already selected then this item will be removed from the current selection.
Hi Eric,
qToggleMode=false doesn't work in my case so the previous selection resists. Any advice?
Best,
Ralf
Ah, I was wrong. Using app.field.selectValues() which doesn't has this feature, or not?
Hi,
app.field.selectValues has a second parameter: toggle. Set that to false and your selections will override the selected values in the field.
Erik