[Users] ExtJs Create Radio Button Tree Nodes
IT Intern
itintern12 at gmail.com
Tue Nov 23 22:01:11 CET 2010
Hello GeoExt users,
I have an Ext.tree.TreePanel that I later add a layer to one of it's child
containers after that container has been created. The child container is an
GeoExt.tree.OverlayLayerContainer. The two things that I am struggling with
are how to set the tree nodes of an GeoExt.tree.OverlayLayerContainer to
radio buttons instead of checkboxes? and how do I add nodes later on to the
container? My attempt at this is below:
function childContainer(text, layerStore, parent, iconCls){
parent.appendChild(new GeoExt.tree.OverlayLayerContainer({
text: text,
layerStore: layerStore,
expanded: true,
iconCls: iconCls, //If not specified, defaults to original image
loader: {param: "LAYERS"}
}));
}//end childContainer
//Container for photo layers
childContainer("Photo Layers", photoLayers, layerRoot);
//In another function
map.addLayer(vectorPano);
layerStore.loadData([vectorPano], true);
var panoNode = new Ext.tree.TreeNode({
leaf: true,
text: 'Panoramio Photos',
checked: false
});
panoNode.addListener("radiochange", function(){
vectorPano.setVisibility(true);
});
var layerContainer = layerRoot.findChild('text', 'Photo Layers');
layerContainer.appendChild(panoNode);
Currently a node is added, but it is a checkbox and when it is clicked on
and off it does not turn the layer on/off. I'd prefer radio buttons nodes..
Thank you for your time,
elshae
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20101123/d3fcdcad/attachment-0001.htm
More information about the Users
mailing list