Home Reference Source
import {Dropdown} from 'guide4you/src/html/Dropdown.js'
public class | source

Dropdown

Expression Extends:

class Dropdown extends mixin(BaseObject, ListenerOrganizerMixin)

A HTML Dropdown select. The text entries in the list can be setted and changed and given a click handler.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

$ghostentry: jQuery

public
public
Private Members
private
private
private
private
private

Method Summary

Public Methods
public

addEntry(value: *, text: string, optSelected: boolean)

Adds an entry to the end of the dropdown list

public

clear()

Removes all entries

public

detach()

public

focus()

public

get$Element(): jQuery

return the whole element

public

Returns the amount of dropdown entries

public

getText(): *

returns the text of the current selected list element

public

getValue(): *

returns the value of the selected list element

public

Returns true if the dropdown has selectable elements

public

select$Entry_($entry: *)

public

setActivated(value: *, active: *)

public

setEntries(values: any[], texts: string[])

This function takes an array of entries (strings).

public

setFastMode(value: *)

public

setLength(length: number)

This function corrects the number of entries in the dropdown.

public
public

slideDown(immediately: boolean): Promise

public

slideUp(immediately: boolean): Promise

Private Methods
private

Public Constructors

public constructor(options: DropdownOptions) source

Params:

NameTypeAttributeDescription
options DropdownOptions
  • optional
  • default: {}

Public Members

public $element_: * source

public $ghostentry: jQuery source

public collapse_: boolean source

public fastMode_: * source

Private Members

private className_: string source

private classNames_: Object<string, string> source

private entriesArray_: Entry[] source

private selectedIndex_: number source

private slideDuration_: number source

Public Methods

public addEntry(value: *, text: string, optSelected: boolean) source

Adds an entry to the end of the dropdown list

Params:

NameTypeAttributeDescription
value *
text string
  • optional
  • default: value
optSelected boolean
  • optional
  • default: false

public clear() source

Removes all entries

public detach() source

public focus() source

public get$Element(): jQuery source

return the whole element

Return:

jQuery

public getLength(): Number source

Returns the amount of dropdown entries

Return:

Number

public getText(): * source

returns the text of the current selected list element

Return:

*

public getValue(): * source

returns the value of the selected list element

Return:

*

public isSelectable(): boolean source

Returns true if the dropdown has selectable elements

Return:

boolean

public select$Entry_($entry: *) source

Params:

NameTypeAttributeDescription
$entry *

public setActivated(value: *, active: *) source

Params:

NameTypeAttributeDescription
value *
active *

public setEntries(values: any[], texts: string[]) source

This function takes an array of entries (strings). The length of the dropdown is set to the length of the arrays (they have to have the same length).

Params:

NameTypeAttributeDescription
values any[]
texts string[]
  • optional
  • default: values

public setFastMode(value: *) source

Params:

NameTypeAttributeDescription
value *

public setLength(length: number) source

This function corrects the number of entries in the dropdown. The content of the entries is not respected. New entries are slided down, to be removed entries are slided up then removed.

Params:

NameTypeAttributeDescription
length number

public showGhostEntry() source

public slideDown(immediately: boolean): Promise source

Params:

NameTypeAttributeDescription
immediately boolean
  • optional
  • default: false

if setted to true the animation is skipped

Return:

Promise

public slideUp(immediately: boolean): Promise source

Params:

NameTypeAttributeDescription
immediately boolean
  • optional
  • default: false

if setted to true the animation is skipped

Return:

Promise

Private Methods

private setUpKeyboardHandling_() source