Dropdown
Dropdown provides a way to display interactive selectors inside the widget header.
The selector can be configured to update a particular widget setting for changes made, such as to the widget type itself, the metric, entity, or property type.
Multiple dropdowns can be declared for each widget.
[dropdown] section
onchange
– if specified, would be evaluated instead default onchange behavior. Either onchange, or change-field is required.change-field
– widget setting changed on dropdown change. To update the widget subsection setting, use the {section-name}.{setting-name} syntax. For example, series.entity or keys.mq_manager_nameformat
– format applied to the option value if notext
setting is specified.style
– css to apply to the select element.options
– comma separated list of option values.
[option] section
- Each option has
value
andtext
attributes available for selection. Iftext
is specified, it would be displayed, otherwise the formattedvalue
would be used.
If onlytext
is specified,value
=text
Example:
[widget]
type = bar
# this drop-down modifies widget type on change
# the list of displayed options is specified in options
field
[dropdown]
options = Chart, Bar, Gauge
change-field = type
[series]
metric = cpu_busy
entity = nurswgvml007
The list of options can be specified with the options =
setting or as a list of [option] fields.
Comma-separated list:
options = opt1, opt2, opt3
Placeholder to ‘list’ of ‘var’ array:
options = @{taglist}
If the list or array may contain elements with comma, use the escape() method to backslash commas:
options = @{taglist.escape()}
[option] fields:
[option] text = opt1 [option] value = opt2 [option] value = opt3 text = Option 3