owner object, typically a panel. For the latter we use a layout. ListItem instances are generated with event listeners. You will not normally need to instantiate the ListItem class. Processing is then handled both by the list items (click: selection; double click: activation) and the panel's OK and Cancel buttons. The geometrical properties x, y, width and height can be overridden. The contents are dynamic thanks to the registered DOMNodeInserted and DOMNodeRemoved event listeners and the scrollbars are managed accordingly, like Window instances. User Function ready.
The example also shows the use of the pergola.notification, a reusable message box created at runtime. It is a preemptive dialog which can be used like a system alert that dosn't stop execution of the script. To use it you simply call the superclass method pergola.message (shortcut: $M) passing a string and an optional object with x and y properties to override its default position.
View standalone combobox.
var myPanel = new pergola.Panel("my panel");
myPanel.build({
title : "PANEL WITH COMBO BOX",
x : 150,
y : 50,
okButton : {
text : "OK"
},
cancelButton : {
text : "Cancel"
},
fn : "listItemFunc",
display : "block",
layout : {
type : "combobox",
y : 60,
list : myList
},
});