# GeoExt

### Navigation

- GeoExt »
- API Reference »
- Widgets »
- `GeoExt.Action`

# `GeoExt.Action`

Extends
  - Ext.Action

class `GeoExt.``Action`(config)
  Create a GeoExt.Action instance. A GeoExt.Action is created to insert an OpenLayers control in a toolbar as a button or in a menu as a menu item. A GeoExt.Action instance can be used like a regular Ext.Action, look at the Ext.Action API doc for more detail.

## Example Use

Sample code to create a toolbar with an OpenLayers control into it.

    var action = new GeoExt.Action({
        text: "max extent",
        control: new OpenLayers.Control.ZoomToMaxExtent(),
        map: map
    });
    var toolbar = new Ext.Toolbar([action]);

## Config Options

Configuration properties in addition to those listed for Ext.Action.

`control`
  `OpenLayers.Control` The OpenLayers control wrapped in this action.

`map`
  `OpenLayers.Map` The OpenLayers map that the control should be added to. For controls that don’t need to be added to a map or have already been added to one, this config property may be omitted.

### Navigation

- index
- modules |
- next |
- previous |
- GeoExt »
- API Reference »
- Widgets »
- `GeoExt.Action`