[Users] How to add register to Action

Oscar Fonts oscar.fonts at gmail.com
Fri Jan 7 13:53:54 CET 2011


Toni, why not let Ext.Button handle the event?
Something like

        var infoButton = new Ext.Button({
            tooltip: 'Informació',
            iconCls: "icon-getfeatureinfo",
            enableToggle: true,
            toggleHandler: function(button, pressed) {
                pressed ? InfoControl.activate() : InfoControl.deactivate()
        }

Where InfoControl would be the OpenLayers control to be activated/deactivated.

Best regards,

Oscar.



2011/1/7 Vidal, Antoni <antoni.vidal at icc.cat>:
> 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
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>


More information about the Users mailing list