Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the QField object and the "select" or "selectValues" methods, but this does not clear other selections outside of the passed array, and if I call the clear() method first, I will re-trigger the the event loop.
How can I tell the field to select only the values I pass in to the method, or to clear, and then select, in a single event?
Thanks.
Make sure "toggle" is set to false. It should be by default
app.field(<field>).selectValues( [<values>] )
but if you do
app.field(<field>).selectValues( [<values>], true )
then "toggle" is set to true and it will toggle selections, instead of the behavior you are looking for.
You can also set "toggle" to false explicitly.
app.field(<field>).selectValues( [<values>], false )
I did have toggle set to "true". However, I am getting a "Function not allowed on this object in app modal mode" error when I try to call selectValues(['MyValue'])? Any ideas how to resolve this?
Thanks.
Update: I think this is because the field selection box is open, but I don't see any events other than OnData that I can attach to, and I don't see any way to determine if the "object is in app modal mode" or not inside of the method.
Hmm, not entirely sure, haven't experienced the problem myself. Maybe using the selectValues method of the Extension API instead of from the Field API would solve your problem? https://help.qlik.com/en-US/sense-developer/3.1/Subsystems/APIs/Content/ExtensionAPI/selectvalues-me...