I have a dashboard with several dropdowns. Some of them have search bars in them and others don't, in what seems to me like a random manner. Is there an option to enable/disable the search bar in a dropdown?
@matstap, when you use Dynamic Option to populate choices in your Dropdown, it will have search bar. But when you have static options it will not. So one of the option to get both dropdown behavior to be similar, would be to use run anywhere Search to populate static options. Following is the search you would need to add to the first dropdown.
| makeresults
| eval data="GMT,GMT;America/Los Angeles,America/Los Angeles"
| makemv data delim=";"
| mvexpand data
| makemv data delim=","
| eval label=mvindex(data,0),value=mvindex(data,1)
| table label value
PS: I have used separate label
and value
values in the search so that if they differ, the same search should still work. If they are always the same your query would be simple to have just the values which will be assigned to label and value both.
On the other hand if you want to hide Search
text box (which by the way is quite useful when you have your Dynamic Search return a lot of values), then you can use CSS to hide the same. I had answered that in past but no able to find the question. So, in case above does not work and you need CSS override to hide the Search box let us know.
In my case, the static option (time zone) resulted in a search bar and the dynamic option (State) resulted in no search bar. Anything else I can try?
Can you post dashboard xml for both the dropdowns?
<input type="dropdown" token="timezone" searchWhenChanged="false">
<label>Time zone</label>
<choice value="GMT">GMT</choice>
<choice value="America/Los Angeles">America/Los Angeles</choice>
<default>GMT</default>
<initialValue>GMT</initialValue>
</input>
<input type="dropdown" token="state">
<label>State</label>
<choice value="""">Select a State</choice>
<fieldForLabel>State</fieldForLabel>
<fieldForValue>State</fieldForValue>
<search>
<query>| inputlookup location_psap.csv | dedup State | fields State</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<default>""</default>
<initialValue>""</initialValue>
</input>