1

I use extjs 3.4.0 and i have a problem with the buttons in the method deactivate.

I create the menu with GeoExt which i put the buttons.

var mapPanel = new GeoExt.MapPanel({
        border: true,
        region: "center",       
        // we do not want all overlays, to try the OverlayLayerContainer
        map: mapa,
        tbar: toolbar, 
        zoom: 3
    });

In this example I put just 2 buttons, the fist is to move and de last is for calculate length. The controls for calculate length is working correctly.

var toggleGroup = "measure controls";

    var buttonMover = new Ext.Button({
        iconCls: 'mover',
        cls: 'margenBoton',     
        enableToggle: true,
        toggleGroup: toggleGroup        
    });

this is the button for length.

var buttonLong = new Ext.Button({
        iconCls: 'regla',
        cls: 'margenBoton',     
        enableToggle: true,
        toggleGroup: toggleGroup,
        handler: function (toggled){
            if (toggled) {
                longitud.activate();
            } else {
                longitud.deactivate();
            }       
        }
    });

here I incorporate my buttons in the panel.

mapPanel.getTopToolbar().addButton(buttonMover);
mapPanel.getTopToolbar().addButton(buttonLong);

The problem is when I choose the length button, I calculate length correctly but I want choose another button or I deactivate this button it doesn't deactivate.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Basa
  • 11
  • 1
  • Did you check the console for errors? Did you step through the handler to see if it's being called? – Ruan Mendes May 21 '14 at 15:55
  • yes. I use firebug but i don't see an error. – Basa May 21 '14 at 15:58
  • What do you mean with activate and deactivate? Maybe you want to disable and enable them: `.setDisabled(true)` and `setDisabled(false)` or maybe you want to `.toggle(true)` and `.toggle(false)` – Darin Kolev May 21 '14 at 21:46
  • With activate or desactivate i supouse that the length's control have to turn on with one click and turn off when i click in other or in the same botton. I tested with longitud.setDisabled(true), longitud.setDisabled(false), longitud.setDisabled() and longitud.setEnabled() but the console throws me "longitud..... is not a function". Thanks you for answer. – Basa May 22 '14 at 13:13

0 Answers0