Print Friendly

# Class YAHOO.ext.ToolbarButton

Package: | YAHOO.ext
Class: | ToolbarButton
Extends: | Object
Defined In: | Toolbar.js

A toolbar button. The config has the following options:

- className - The CSS class for the button. Use this to attach a background image for an icon.
- text - The button's text
- tooltip - The buttons tooltip text
- click - function to call when the button is clicked
- mouseover - function to call when the mouse moves over the button
- mouseout - function to call when the mouse moves off the button
- scope - The scope of the above event handlers

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| disable() : void | ToolbarButton
Disable this button
| enable() : void | ToolbarButton
Enable this button
| hide() : void | ToolbarButton
Hide this button
| isDisabled() : Boolean | ToolbarButton
Returns true if this button is disabled.
| setHandler(`Function click`, [`Object scope`]) : void | ToolbarButton
Sets this buttons click handler
| setText(`String text`) : void | ToolbarButton
Set this buttons text
| setTooltip(`String text`) : void | ToolbarButton
Set this buttons tooltip text
| show() : void | ToolbarButton
Show this button

## Public Events

This class has no public events.

## Method Details

### disable

`public function disable()`
Disable this button
Parameters:

- None.

Returns:

- `void`

This method is defined by ToolbarButton.

### enable

`public function enable()`
Enable this button
Parameters:

- None.

Returns:

- `void`

This method is defined by ToolbarButton.

### hide

`public function hide()`
Hide this button
Parameters:

- None.

Returns:

- `void`

This method is defined by ToolbarButton.

### isDisabled

`public function isDisabled()`
Returns true if this button is disabled.
Parameters:

- None.

Returns:

- `Boolean`

This method is defined by ToolbarButton.

### setHandler

`public function setHandler(`Function click`, [`Object scope`])`
Sets this buttons click handler
Parameters:

- `click` : Function
  The function to call when the button is clicked
- `scope` : Object
  (optional) Scope for the function passed above

Returns:

- `void`

This method is defined by ToolbarButton.

### setText

`public function setText(`String text`)`
Set this buttons text
Parameters:

- `text` : String

Returns:

- `void`

This method is defined by ToolbarButton.

### setTooltip

`public function setTooltip(`String text`)`
Set this buttons tooltip text
Parameters:

- `text` : String

Returns:

- `void`

This method is defined by ToolbarButton.

### show

`public function show()`
Show this button
Parameters:

- None.

Returns:

- `void`

This method is defined by ToolbarButton.

Copyright © 2006 Jack Slocum. All rights reserved.