[Users] Adding a menu item to an existing Tbar, not working

Andrew Stewart Andrew.Stewart at reddeer.ca
Mon Oct 4 19:27:29 CEST 2010


I am trying to add a button with a menu to my existing toolbar but unfortunately when I click on it the drawfeature control associated with the button won't fire and the pan tool stays active. If I just add the GeoExt.Action that adds redline directly to the tbar this works, but if I add the menu with it it doesn't. Not sure what I am missing here just trying to get a menu because I want to allow the drawfeature to use options for a line or polygon. Any help appreciated.



/ -------- Begin RedLine Menu ------------------------//

                //Redline Action
                var action_RedLine = new GeoExt.Action({
                text: "Redline",
                control: drawFeature,
                map: map,
                // button options
                toggleGroup: "tools",
                allowDepress: false,
                group: "tools"
                });

                var menu = new Ext.menu.Menu({
                id: 'basicMenu',
                text: 'Redline Menu',
                map: map,
                items: [action_RedLine]
                });

                var redline_button = new Ext.Button({
                menu: menu,
                toggleGroup: "tools",
                allowDepress: false,
                group: "tools",
                map: map
                });

// ------ End Redline Menu --------------//

           var mapPanel = new GeoExt.MapPanel({
            collapsed: false,
            height: 800,
            renderTo: '',
            map: map,
            center: lonLat,
            zoom: startupLevel,
            tbar:[action_Home, '-', action_Queries , '-', action_ZoomIn, '-', action_ZoomOut, '-', action_ZoomPrevious , '-', action_Pan, '-', action_CenterMap,
            '-', action_FitMap, '-', redline_button, '-', action_Print, '-' , action_Help, '-' ,action_Tutorial]
            });







-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20101004/2c172a88/attachment.htm 


More information about the Users mailing list