Class: Button

ol.control. Button

A simple push button control


new Button( [options])

Parameters:
Name Type Argument Description
options Object <optional>

Control options.

Properties
Name Type Argument Description
id String <optional>

button id, default generate a unique id

className String <optional>

class of the control

classButton String <optional>

class of the button

title String <optional>

title of the control

name String <optional>

an optional name, default none

html String <optional>

html to insert in the control

handleClick function <optional>

callback when control is clicked (or use change:active event)

attributes Object <optional>

key value attributes to set on the button element

Extends

Methods


getButtonElement()

Get the button element

Returns:
Type
Element

getDisable()

Test if the control is disabled.

Returns:
Type
bool

setDisable(b)

Disable the control button.

Parameters:
Name Type Description
b bool

disable (or enable) the control, default false (enable)


setHtml(html)

Set the button html

Parameters:
Name Type Description
html string

setTitle(title)

Set the button title

Parameters:
Name Type Description
title string

setVisible(b)

Set the control visibility

Parameters:
Name Type Description
b boolean