If you're trying to now when a button corresponding to an action is
clicked, you can add an handler property to your action's config.
There should be no need to use an OpenLayers control for that and even
no need to use a GeoExt.Action.

var action = new Ext.Action({
    tooltip: 'Info',
    iconCls: 'drawpolygon',
    toggleGroup: 'map',
    handler: function(button) {
        // do something
    }
});

Even more, you can simply use an Ext.Button (with the same config)
instead of an Action.

Does that make sense ?

Pierre

On Fri, Jan 7, 2011 at 12:03 PM, Vidal, Antoni <[email protected]> wrote:
> Hello list,
>
>
>
> I trying to register a “mousedown” event to an action button but it doesn’t
> work with the following code:
>
>
>
>         action = new GeoExt.Action({
>
>             control: new OpenLayers.Control({eventListeners: {"mousedown":
> this.handleMousedown}}),
>
>             tooltip: 'Info',
>
>             map: map,
>
>             iconCls: 'drawpolygon',
>
>             toggleGroup: 'map'
>
>         });
>
>
>
>         action.control.events.on({
>
>            "mousedown": handleMousedown
>
>         });
>
>
>
>         actions.push(action);
>
>
>
> Any help would be appreciatte.
>
>
>
> Thanks
>
>
>
> Antoni Vidal
>
> Unitat d'Aplicacions SIG-WEB
> Institut Cartogràfic de Catalunya
> Parc de Montjuïc, E-08038 Barcelona
> Tel. (+34) 93 567 15 00 (ext. 3228)
> www.icc.cat
>
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>



-- 
Pierre GIRAUD
Géomaticien, Analyste

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 93
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to