<canvas
height
="150
">
<include
href
="lz/floatinglist.lzx
"/>
<dataset
name
="items
">
<item
value
="item0
">item 0
</item
>
<item
value
="item1
">item 1
</item
>
<item
value
="item2
">item 2
</item
>
<item
value
="item3
">item 3
</item
>
<item
value
="item4
">item 4
</item
>
<item
value
="item5
">item 5
</item
>
<item
value
="item6
">item 6
</item
>
<item
value
="item7
">item 7
</item
>
<item
value
="item8
">item 8
</item
>
<item
value
="item9
">item 9
</item
>
<item
value
="item10
">item 10
</item
>
<item
value
="item11
">item 11
</item
>
</dataset
>
<class
name
="simplecombobox
" extends
="basedatacombobox
" width
="100
">
<attribute
name
="_cbtext
" value
="$once{this._text}
"/>
<attribute
name
="menuclassname
" value
="floatinglist
" type
="string
"/>
<view
width
="100%
" height
="20
" focusable
="false
" bgcolor
="#CCCCCC
">
<handler
name
="onclick
">
lz.Focus.setFocus(this,false);
classroot.toggle()
</handler
>
<handler
name
="onmouseout
">
this.setAttribute('bgcolor', 0xCCCCCC);
</handler
>
<handler
name
="onmouseup
">
this.setAttribute('bgcolor', 0xCCCCCC);
</handler
>
<handler
name
="onmouseover
">
this.setAttribute('bgcolor', 0xEEEEEE);
</handler
>
<handler
name
="onmousedown
">
this.setAttribute('bgcolor', 0xAAAAAA);
</handler
>
</view
>
<text
name
="_text
" width
="${ parent.width - 19 }
" x
="7
"/>
</class
>
<simplecombobox
id
="cbox1
" width
="130
" shownitems
="6
" defaulttext
="Choose One...
" itemdatapath
="items:/item
"/>
</canvas
>
node.parentNode.replaceChild(node.cloneNode(true), node)
where node is the dataelement of the list item. Don't forget
to reset the seleciton on the list, as well.
Name (CSS property) | Type (tag) | Type (js) | Default | Category |
---|---|---|---|---|
defaulttext
|
string | String | null | read/write |
Default text to display before a selection is made. No default item is selected if defaulttext is set. Defaulttext is replaced with selected item's text. | ||||
ismenu
|
expression | any | false | read/write |
If true, the combobox will behave like a menu. "value" is ignored, and items will not remain selected. Selecting an item generates an onselect event | ||||
isopen
|
expression | any | false | read/write |
Indicates whether or not the popup list is showing. | ||||
itemclassname
|
string | String | read/write | |
The name of the class for items in the floating list. | ||||
itemdatapath
|
string | String | null | read/write |
Datapath to items in list. | ||||
listattach
|
string | String | bottom | read/write |
Where the floatinglist should attach to its owner. Possible values: bottom, top, left, right. In the event of a canvas out-of-bounds, the floating list will attach in a visible location. | ||||
listwidth
|
expression | any | null | read/write |
Width of popup list, defaults to width of combobox view. During setup, the width of the floating list view might not yet be set, so this returns the expected width. | ||||
menuclassname
|
string | String | read/write | |
selected
|
expression | any | null | readonly |
Datapointer to selected item. | ||||
selectfirst
|
expression | any | true | read/write |
When true, the 1st item is selected oninit. | ||||
shownitems
|
expression | any | 4 | read/write |
Sets the height to the number of items to show in combobox popup list. Must be greater than 0. | ||||
statictext
|
string | String | null | read/write |
If set, this will always be displayed instead of selected item text. Behaves like a menu button. Also see defaulttext. | ||||
textdatapath
|
string | String | text() | read/write |
Datapath to text to display for items in list. See caveat. | ||||
value
|
expression | any | null | read/write |
The value of the selected item. | ||||
valuedatapath
|
string | String | @value | read/write |
Datapath to value for items in list. See caveat. |
changed, ignoreform, rollbackvalue, submit, submitname, value
doesenter, enabled, hasdefault, isdefault, style, styleable, text
aaactive, aadescription, aaname, aasilent, aatabindex, align, backgroundrepeat, bgcolor, cachebitmap, capabilities, clickable, clickregion, clip, colortransform, context, contextmenu, cornerradius, cursor, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hasdirectionallayout, hassetheight, hassetwidth, height, layout, loadratio, mask, opacity, pixellock, playing, proxyurl, resource, resourceheight, resourcewidth, rotation, shadowangle, shadowblurradius, shadowcolor, shadowdistance, showhandcursor, source, stretches, subviews, tintcolor, totalframes, unstretchedheight, unstretchedwidth, usegetbounds, valign, visibility, visible, width, x, xoffset, xscale, y, yoffset, yscale
classroot, cloneManager, data, datapath, defaultplacement, id, ignoreplacement, immediateparent, inited, initstage, name, nodeLevel, options, parent, placement, styleclass, subnodes, transition
Methods
doSetChanged() |
---|
doSetValue() |
---|
Parameter Name | Type | Description |
---|---|---|
value | String|Number | value to set. |
isinitvalue | Boolean | true if value is an init value. |
ignoreselection | Boolean | if true, selection won't be updated |
getItemIndex() |
---|
getValue() |
---|
selectItem() |
---|
selectItemAt() |
---|
setOpen() |
---|
toggle() |
---|
commit, destroy, findForm, init, rollback, setChanged, setValue, toXML
acceptValue, doEnterDown, doEnterUp, doSpaceDown, doSpaceUp, presentValue, setStyle, setTint, updateDefault
bringToFront, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getCurrentTime, getDepthList, getDisplayObject, getID3, getMouse, getNextSelection, getPan, getPrevSelection, getProxyURL, getTotalTime, getVolume, init, isBehind, isInFrontOf, isMouseOver, measureHeight, measureWidth, play, proxyurl, searchSubviews, seek, sendAAEvent, sendBehind, sendInFrontOf, sendToBack, setAccessible, setAttributeRelative, setColor, setColorTransform, setPan, setProxyPolicy, setSource, setVolume, shouldYieldFocus, stop, unload, updateResourceSize
animate, applyConstraintMethod, applyData, childOf, completeInstantiation, construct, createChildren, dataBindAttribute, destroy, determinePlacement, getOption, getUID, init, lookupSourceLocator, releaseConstraint, releaseConstraintMethod, searchImmediateSubnodes, searchSubnodes, setOption, setSelected, updateData
Events
onaddsubview, onbackgroundrepeat, onblur, onclick, onclickable, onclip, oncontext, oncornerradius, ondblclick, onerror, onfocus, onframe, onframesloadratio, ongesture, onheight, onkeydown, onkeyup, onlastframe, onload, onloadratio, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmousetrackout, onmousetrackover, onmousetrackup, onmouseup, onmouseupoutside, onopacity, onplay, onplaying, onremovesubview, onshadowangle, onshadowblurradius, onshadowcolor, onshadowdistance, onstop, ontimeout, ontouch, onvisible, onwidth, onx, ony
Copyright © 2002-2010 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.