class DropDownWidget
view source
extends WidgetGroupBase
extends TextWidgetBase
extends ColoredWidgetBase
extends WidgetBase
extends EventListener
DropDown widget.
new DropDownWidget(opts : Object)
Parameters
opts | Object | instantiation options |
opts.appHash | number | internal app hash |
opts.appWidget | ApplicationWidget | early ApplicationWidget link |
opts.auiTag | number | internal aui tag id |
opts.inTable | boolean | internal is in table |
opts.inMatrix | boolean | internal is in matrix |
opts.inFirstTableRow | boolean | internal |
opts.inScrollGrid | boolean | internal is in a scroll grid |
opts.ignoreLayout | boolean | ignore layout char measurer |
autoSize : boolean
Flag to indicate if dropdown should size accordingly to its parent element (parent element width aligned) with a maximum allowed height (afterwards dropdown is vertically scrollable) By default no.
isDropDown : boolean
Flags current class as being a dropdown. Can be useful to know if a parent widget is dropdown
maxHeight : number
Maximum height of the dropdown to use if not null.
maxWidth : number
Maximum width of the dropdown to use if not null.
minWidth : number
Minimum width of the dropdown to use if not null.
parentElement : HTMLElement
Parent element to use to measure and position DropDown instead of default one (default one is parent widget element).
renderFunction : function
Custom rendering function to use instead of integrated one to measure and render the dropdown. The function is null by default.
reverseX : boolean
Flag to position dropdown using right-to-left basis (ex: arabic). Take note that to have a full right-to-left mode the parent widget need to be set as reversed using setReverse method By default its left-to-right positioned.
reverseY : boolean
Flag to position dropdown below its corresponding widget or above it. By default its positioned below it.
x : number
Horizontal absolute position. It replace default widget relative positioning if not null.
y : number
Vertical absolute position of the dropdown. It replace default widget relative positioning if not null.
addChildWidget(widget : WidgetBase, options : Object)
[inherits from WidgetGroupBase]
addClass(className : string)
[inherits from WidgetBase]
addDropDown()
Add dropdown in DOM and set its position & size
adoptChildWidget(widget : WidgetBase, options : Object)
[inherits from WidgetGroupBase]
Add a child widget which has already a parent to the widget
Parameters
bindListeners()
Let dropdown hide on click (if outside of dropdown and widget), scroll events or dragAndDrop events. Setting this method to null will cancel auto hide of the dropdown
detach()
[inherits from WidgetBase]
Detach the widget from the dom
emit(type : string, arguments… : any)
[inherits from EventListener]
empty()
[inherits from WidgetGroupBase]
Remove all children
focus()
Explicitly focus dropdown element
getApplicationIdentifier()
: (string)
[inherits from WidgetBase]
Get the unique identifier of the application
Returns
getApplicationWidget()
: (ApplicationWidget)
[inherits from WidgetBase]
Get Application Widget related to the widget
Returns
getBackgroundColor()
: (string)
[inherits from ColoredWidgetBase]
Returns the background color
Returns
getBuildParameters()
: (Object)
[inherits from WidgetBase]
Returns build parameters
Returns
getChildren()
: (Array)
[inherits from WidgetGroupBase]
Get all children of this widget
Returns
getClassName()
: (string)
[inherits from WidgetBase]
Get the main class name of the widget
Returns
getColor()
: (string)
[inherits from ColoredWidgetBase]
Returns the fore color
Returns
getColorFromStyle()
: (string)
[inherits from ColoredWidgetBase]
Returns the fore color (directly from style css)
Returns
getContainerElement()
: (HTMLElement)
[inherits from WidgetGroupBase]
Get the container Element
Returns
getCurrentChildren()
: (WidgetBase)
[inherits from WidgetGroupBase]
Returns current widget (flagged with 'current' class)
Returns
getDialogType()
: (string)
[inherits from WidgetBase]
return widget current dialog type
Returns
getElement()
: (HTMLElement)
[inherits from WidgetBase]
Get the root element of the widget
Returns
getEnd()
: (string)
[inherits from WidgetBase]
Get end (for reversed mode)
Returns
getFontColor()
: (string)
[inherits from TextWidgetBase]
Get the font color used by this widget
Returns
getFontFamily()
: (string)
[inherits from TextWidgetBase]
Get the font-family used by this widget
Returns
getFontSize()
: (string)
[inherits from TextWidgetBase]
Get the font-size used by this widget
Returns
getFontStyle()
: (string)
[inherits from TextWidgetBase]
Get the font-style used by this widget
Returns
getFontWeight()
: (string)
[inherits from TextWidgetBase]
Get the font-family used by this widget
Returns
getFormWidget()
: (FormWidget)
[inherits from WidgetBase]
Get the Form Widget related to the widget
Returns
getIndexOfChild(widget : WidgetBase)
: (number)
[inherits from WidgetGroupBase]
getLayoutEngine()
: (LayoutEngineBase)
[inherits from WidgetBase]
Get the widget's layout engine
Returns
getLayoutInformation()
: (LayoutInformation)
[inherits from WidgetBase]
Get the widget's layout information
Returns
getName()
: (string)
[inherits from WidgetBase]
Get the name of the widget class
Returns
getParentWidget()
: (WidgetGroupBase)
[inherits from WidgetBase]
Get the parent widget
Returns
getStart()
: (string)
[inherits from WidgetBase]
Get start (for reversed mode)
Returns
getStyle(selector : string, property : string, appliesOnRoot : boolean)
: (any)
[inherits from WidgetBase]
getTableWidgetBase()
: (TableWidgetBase)
[inherits from WidgetBase]
Get the table Widget base class related to the widget
Returns
getTextAlign()
: (string)
[inherits from TextWidgetBase]
Get the text-align used by this widget
Returns
getTextDecoration()
: (string)
[inherits from TextWidgetBase]
Get the text-decoration used by this widget
Returns
getTextTransform()
: (string)
[inherits from TextWidgetBase]
Get the text-transform used by this widget
Returns
getTitle()
: (string)
[inherits from WidgetBase]
Get the title of the widget
Returns
getUniqueIdentifier()
: (string)
[inherits from WidgetBase]
Get the unique identifier of the widget
Returns
getUserInterfaceWidget()
: (UserInterfaceWidget)
[inherits from WidgetBase]
Get the UI widget related to the widget
Returns
getWindowWidget()
: (WindowWidget)
[inherits from WidgetBase]
Get the Window Widget related to the widget
Returns
hasChildWebComponent()
: (boolean)
[inherits from WidgetGroupBase]
returns true if a WebComponent is contained in any sublevel child
Returns
hasClass(className : string)
[inherits from WidgetBase]
hasFocus()
: (boolean)
[inherits from WidgetBase]
Check if widget node has focus (class gbc_Focus)
Returns
hasVMFocus()
: (boolean)
[inherits from WidgetBase]
Check if widget node has VM focus
Returns
hide()
Hide all displayed dropdowns
ignoreLayout()
: (boolean)
[inherits from WidgetBase]
Does the widget ignore layouting
Returns
isChildOf(parent : WidgetBase)
: (boolean)
[inherits from WidgetBase]
Check if this widget is a child of a given one
Parameters
parent | WidgetBase | the reference parent widget |
Returns
isDestroyed()
: (boolean)
[inherits from EventListener]
Returns if the node is destroyed
Returns
isEnabled()
: (boolean)
[inherits from WidgetBase]
Check if widget is enabled
Returns
isFocusable()
: (boolean)
[inherits from WidgetBase]
Returns if the widget is focusable
Returns
isHidden()
: (boolean)
[inherits from WidgetBase]
Check if the widget is hidden
Returns
isInMatrix()
: (boolean)
[inherits from WidgetBase]
Check if the widget is in a matrix
Returns
isInTable()
: (boolean)
[inherits from WidgetBase]
Check if the widget is in a table
Returns
isNoBorder()
: (boolean)
[inherits from WidgetBase]
Check if the widget is displayed without border
Returns
isReversed()
: (boolean)
[inherits from WidgetBase]
Check if arabic mode is enabled
Returns
isVisible()
: (boolean)
Indicate if dropdown if currently visible or not
Returns
loseFocus()
[inherits from WidgetBase]
Called before setFocus to notify previous focused widget
loseVMFocus()
[inherits from WidgetBase]
Called before setting VM focus to notify previous VM focused widget
removeChildWidget(widget : WidgetBase)
[inherits from WidgetGroupBase]
removeClass(className : string)
[inherits from WidgetBase]
removeContent(content : HTMLElement)
Remove the content of the dropdown
Parameters
content | HTMLElement | element to remove from the dropdown |
removeDropDown()
Remove the dropdown from the DOM
removeTextTransform()
[inherits from TextWidgetBase]
Remove both class which cause text-transform
renderDropDown()
Render the dropdown. Measure its width, height and calculate its top and left position and sets them. By default dropdown will : - take width of its corresponding widget. - be positioned right under the corresponding widget and left aligned with it.
replaceChildWidget(oldWidget : WidgetBase, newWidget : WidgetBase)
[inherits from WidgetGroupBase]
Remove a child widget to use another widget instead
Parameters
oldWidget | WidgetBase | the widget to replace |
newWidget | WidgetBase | the widget to add |
replaceWith(widget : WidgetBase)
[inherits from WidgetBase]
setBackgroundColor(color : string, notImportant : boolean)
[inherits from ColoredWidgetBase]
setColor(color : string)
[inherits from ColoredWidgetBase]
Set the fore color
Parameters
color | string | a CSS color definition. Can be a color name ('red', 'blue'), an hex code ('#f5d48a') or a color function ('rgb(128, 255, 0)'). null restores the default value. |
setContent(content : HTMLElement, parentWidget : WidgetBase)
Set content of the dropdown
Parameters
content | HTMLElement | element to add in the dropdown |
parentWidget | WidgetBase | if defined, set the widget as parent widget of the dropdown (optional) |
setDialogType(dialogType : string)
[inherits from WidgetBase]
Set widget current dialog type. Can be Input, Input Array, Display, Display Array or Construct
Parameters
dialogType | string | Dialog type |
setFocus(fromMouse : boolean, stayOnSameWidget : boolean)
[inherits from WidgetBase]
setFocusable(focusable : boolean)
[inherits from WidgetBase]
setFontColor()
: (string)
[inherits from TextWidgetBase]
Set the font color used by this widget
Returns
setFontFamily(fontFamily : string)
[inherits from TextWidgetBase]
Set the font-family used for this widget
Parameters
fontFamily | string | the font family to use. null restores the default value. |
setFontSize(size : string)
[inherits from TextWidgetBase]
Set the font-size used for this widget
Parameters
size | string | a CSS font size value. null restores the default value. |
setFontStyle(style : string)
[inherits from TextWidgetBase]
Set the font-style used for this widget
Parameters
style | string | a CSS font style value. null restores the default value. |
setFontWeight(weight : string)
[inherits from TextWidgetBase]
Set the font weight used for this widget
Parameters
weight | string | a CSS font weight value. null restores the default value. |
setHidden(hidden : boolean)
[inherits from WidgetBase]
Defines if the widget should be hidden or not
Parameters
hidden | boolean | true if the widget is hidden, false otherwise |
setNoBorder(noBorder : boolean)
[inherits from WidgetBase]
Remove or add borders to the widget
Parameters
noBorder | boolean | true if the widget has no border class, false otherwise |
setParentWidget(widget : WidgetGroupBase, options : Object)
[inherits from WidgetBase]
Defines the parent widget
Parameters
widget | WidgetGroupBase | the widget to use as parent |
options | Object | possible options |
options.noLayoutInvalidation | boolean | won't affect parent layout |
setReverse(rtl : boolean)
[inherits from WidgetBase]
setTextAlign(align : string)
[inherits from TextWidgetBase]
Set the text-align used for this widget
Parameters
align | string | a CSS text alignment. null restores the default value. |
setTextDecoration()
[inherits from TextWidgetBase]
Set the text-decoration used for this widget
setTextTransform(transform : string)
[inherits from TextWidgetBase]
Set the text-transform used for this widget
Parameters
transform | string | a CSS text transform. null restores the default value. |
setTitle(title : string)
[inherits from WidgetBase]
toggleClass(className : string, switcher : boolean)
[inherits from WidgetBase]
translate()
[inherits from WidgetBase]
Translate the widget
unbindListeners()
Unbind events and listeneners used to auto hide dropdown