Class: CustomSwitcherControl

cercalia.Control.CustomSwitcherControl

Let you create a selector menu with a list of options, and assign a click event to each option
The options to be included by parameter are
Example:

    var option1 = {name:'opcio_1',className:'class1',clickFunction:function(){alert('1');}};
    var option2 = {name:'opcio_2',className:'class2',clickFunction:function(){alert('2');}};
 var customSwitcherControl = new cercalia.Control.CustomSwitcherControl({
     name : 'Switcher1',
     name : 'Custom selector menu',
     menuOptions : [option1,option2]
 });

new cercalia.Control.CustomSwitcherControl(option)

Name Type Description
option cercaliax.Control.CustomSwitcherControlOptions

Extends

Methods

addOption(option, position)

Name Type Description
option Object

Option to add

position number | undefined optional

Position on list

getClass(){string} inherited

Returns:
class

getElement(){HTMLElement} inherited

Obtain the control DOM element

Returns:
DOM Element

getElementList(){HTMLElement}

Returns the HTML element for every created menu.

Returns:
Returns the label name assigned to the control

Returns the control name

Returns:
Control name

Hide the control

Returns index of option.

Name Type Description
option Object

Option to check the index

Remove option by option

Name Type Description
options Object

Option to remove

removeOptionByIndex(index)

Remove option with index

Name Type Description
index number

of option

removeOptionByName(name)

Remove all options with the same name

Name Type Description
name string

Name of option

Shows the control