My method -
layercontainers = [];
for (i = 0; i < groups.length;i++){
layercontainers[i] = {
nodeType: "gx_layercontainer",
text:groups[i],
layerStore: mapPanel.layers,
leaf:false,
expanded:true,
loader:{
group: groups[i],
filter:function(record){
return record.get("layer").group == this.group;
}
}
};
}
tree.setRootNode({
children: layercontainers
});
"group" is an attribute that I added to layers. Actually its easier if
you add group to options as can then set it in layer constructor.
--
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St,
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232
Notice: This email and any attachments are confidential. If received in error
please destroy and immediately notify us. Do not copy or disclose the contents.
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users