pyiem.htmlgen module#
Utility functions that generate HTML.
- pyiem.htmlgen.station_select(network, selected, name, select_all=False, only_online=False)[source]#
Select a station from a given network.
- Parameters:
- Return type:
html_string
- pyiem.htmlgen.make_select(name, selected, data, jscallback=None, cssclass=None, multiple=False, showvalue=True)[source]#
Generate a HTML select element.
The trick here is what
datalooks like. The basic form is adict. You can getoptgroupby having the dictionary keys be additional lists or dicts.- Parameters:
name (str) – The select name attribute to assign.
selected (mixed) – The option value that should be set to selected.
data (dict) – The structure to build our select from.
jscallback (str) – javascript to place in the
onChangeattribute.cssclass (str) – CSS class to assign to the select element.
showvalue (bool) – Should option label be prepended by key label.
- Return type:
html_string