PDA

View Full Version : how to reset the button in a toolbar



robertdbuckley
20 Mar 2012, 6:28 AM
I would like to be able to reset my toolbar.ie set all buttons to depressed= false.

I can get the toolbar using mapPanel.getTopToolbar but donīt know how I can iterate through al of the actions and set their properties.
Here is my code for the toolbar...any help would be great,

cheers,
Rob



var toolbarItems = [];
var action, actions = {};


// var Navigation = new OpenLayers.Control.Navigation();

action = new GeoExt.Action({
control: new OpenLayers.Control.ZoomBox({
alwaysZoom: true
}),
icon: 'images_big/01_zoom_in.png',
map: map,
tooltip: {
title: 'Hereinzoomen',
text: 'mit der linken Maustaste ein Rechteck ziehen um auf ein Gebiet heranzuzoomen'
},
toggleGroup: 'mapTools',
group: 'mapTools'
});

toolbarItems.push('');
toolbarItems.push(action);

mitchellsimoens
20 Mar 2012, 8:29 AM
If you can get the toolbar, you can get the items. You can then iterate through the items.