Zebra API Doc

zebra.ui.Combo Class

Extends zebra.ui.Panel

Combo box UI component class. Combo uses a list component to show in drop down window. You can use any available list component implementation:

   // use simple list as combo box drop down window
   var combo = new zebra.ui.Combo(new zebra.ui.List([
       "Item 1",
       "Item 2",
       "Item 3"
   ]));


   // use component list as combo box drop down window
   var combo = new zebra.ui.Combo(new zebra.ui.CompList([
       "Item 1",
       "Item 2",
       "Item 3"
   ]));


   // let combo box decides which list component has to be used
   var combo = new zebra.ui.Combo([
       "Item 1",
       "Item 2",
       "Item 3"            
   ]);

Constructor

zebra.ui.Combo

(
  • data
)

Parameters:

Methods

catchInput

(
  • c
)
Boolean

Inherited from zebra.ui.Composite:

The method is called to ask if the given children UI component has to be input events transparent

Parameters:


Return: Boolean

true if the given children component has to be input events transparent

fired

(
  • src
)

Combo box button listener method. The method triggers showing combo box pad window when the combo button has been pressed

Parameters:

getValue

() Object

Get the current combo box selected value


Return: Object

a value

hidePad

()

Hide combo drop down list

keyPressed

(
  • e
)

Define key pressed events handler

Parameters:

keyTyped

(
  • e
)

Define key typed events handler

Parameters:

mousePressed

(
  • e
)

Define mouse pressed events handler

Parameters:

select

(
  • i
)

Select the given value from the list as the combo box value

Parameters:

  • i Integer

    an index of a list element to be selected as the combo box value

setList

(
  • l
)

Bind the given list component to the combo box component.

Parameters:

setMaxPadHeight

(
  • h
)

Set the maximal height of the combo box pad element.

Parameters:

  • h Integer

    a maximal combo box pad size

setSelectionView

(
  • c
)

Set the given combo box selection view

Parameters:

setValue

(
  • v
)

Set combo box value selected value.

Parameters:

  • v Object

    a value

showPad

()

Show combo drop down list

Attributes

button

zebra.ui.Panel readonly

Reference to combo box button component

content

zebra.ui.Panel readonly

Reference to combo box content component

list

zebra.ui.BaseList readonly

Reference to combo box list component

maxPadHeight

Integer readonly

Maximal size the combo box height can have

selectionView

zebra.ui.View readonly

Reference to selection view

winpad

zebra.ui.Panel readonly

Reference to combo box pad component

Events

selected

Fired when a new value in a combo box component has been selected

combo.bind(function(combo, value) {
    ...
});

Event Parameters:

  • combo zebra.ui.Combo

    a combo box component where a new value has been selected

  • value Object

    a previously selected index