Zebra API Doc

zebra.ui.SwitchManager Class

The standard UI checkbox component switch manager implementation. The manager holds boolean state of a checkbox UI component. There are few ways how a checkbox can switch its state: standard checkbox or radio group. In general we have a deal with one switchable UI component that can work in different modes. Thus we can re-use one UI, but customize it with appropriate switch manager. That is the main idea of having the class.

Constructor

zebra.ui.SwitchManager

()

Methods

getValue

(
  • o
)
Boolean

Get current state of the given UI component

Parameters:


Return: Boolean

a boolean state

install

(
  • o
)
protected

Call when the manager has been installed for the given UI component

Parameters:

setValue

(
  • o
  • b
)

Set the state for the given UI component

Parameters:

stateUpdated

(
  • o
  • b
)

Called every time a state has been updated.

Parameters:

  • o zebra.ui.Checkbox

    an ui component for which the state has been updated

  • b Boolean

    a new boolean state of the UI component

uninstall

(
  • o
)
protected

Call when the manager has been uninstalled for the given UI component

Parameters:

Events

stateUpdated

Fired when a state has been updated

   var ch = new zebra.ui.Checkbox("Test");
   ch.manager.bind(function (src, ui) {
       ...
   });

Event Parameters: