Index | OAT homepage | OpenLink Software

# OATDOCcombobutton

- OATDOCcombobutton
- _ _ combobutton.js
- _ _ _ _ Objects
- _ _ _ _ _ _ OAT.Combobutton()
- _ _ _ _ Methods
- _ _ _ _ _ _ OAT.Combobutton::addOption(imagePath, textValue, callback)
- _ _ _ _ _ _ OAT.Combobutton::removeOption(index)
- _ _ _ _ CSS classes
- _ _ _ _ _ _ .combo_button
- _ _ _ _ _ _ .combo_image
- _ _ _ _ _ _ .combo_button_option
- _ _ _ _ _ _ .combo_button_text
- _ _ _ _ _ _ .combo_button_down
- _ _ _ _ Example

## combobutton.js

Creates a combobutton, which is a multi-functional button. It enables user to specify a callback action to be performed when it is clicked.

### Objects

#### OAT.Combobutton()

Creates a combobutton. Its main div is accessible as `OAT.Combobutton::div` .

### Methods

#### OAT.Combobutton::addOption(imagePath, textValue, callback)

Adds a new option, described as `textValue` with image located at `imagePath` . When this option is clicked, `callback` is called.

#### OAT.Combobutton::removeOption(index)

Removes `index` -th option.

### CSS classes

#### .combo_button

CSS class of the button options list.

#### .combo_image

CSS class of the dropdown clicker image.

#### .combo_button_option

CSS class of the button option div.

#### .combo_button_text

CSS class of the div with textual description of the option.

#### .combo_button_down

CSS class that is added/removed to option whenever the button is clicked/released.

### Example

    var cb = new OAT.Combobutton();
    document.body.appendChild( cb.div );
    cb.addOption("img1.gif", "option 1", function(){});
    cb.addOption("img2.gif", "option 2", function(){});
    cb.removeOption(0);

Copyright (C) 2005-2008 OpenLink Software