combolist.js
Creates a combolist, <select> with additional possibility of direct user input.
Objects
OAT.Combolist(optList, defaultValue, optionsObject)
Creates a combolist containing values from optListarray, with a value of defaultValue.
Its main div is accessible as OAT.Combolist::div.
Onchange callback may be set via OAT.Combolist::onchange property.optionsObject may contain:
- name - html name attribute for relevant input tag
- imagePath
Methods
OAT.Combolist::addOption(label, value)
Adds a new option labeled label with value of value. If value is not specified, label is used instead.
OAT.Combolist::clearOpts()
Clears all options.
CSS classes
.combo_list
CSS class of the combolist div.
.combo_list_input
CSS class of the text input field option.
.combo_list_option
CSS class of the regular option.
.combo_list_list
CSS class of the option list.
Example
var cl = new OAT.Combolist([],"default",{name:"myName"}); document.body.appendChild( cl.div ); cl.addOption("option 1"); cl.addOption("option 2","value 2");
Referenced by...