Tip: Use the string-based listbox methods
September 5th, 2008 | Published in Google Desktop API
If you have a listbox or combobox that displays text strings, consider using methods such as
appendString()
and removeString()
instead of appending item elements. Read the 5.5 release notes to see the available methods and examples of their use.Here is an example that fills a listbox named
statesListbox
:
var states = ['Alabama', 'Alaska', ... ];Have a tip you'd like to share? Send it to gd-developer AT google DOT com. To see all tips, choose the Tips label.
for (var i = 0; i statesListbox.appendString(states[i]);
}
// We are not allowed to ship to California.
statesListbox.removeString('California');