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.

drop-down-header

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_name
  • format – format applied to the option value if no text setting is specified.
  • style – css to apply to the select element.
  • options – comma separated list of option values.

[option] section

  • Each option has value and text attributes available for selection. If text is specified, it would be displayed, otherwise the formatted value would be used.
    If only text 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