[Users] Parent and Child Nodes (Layers) with gx_layercontainers

Andreas Hocevar ahocevar at opengeo.org
Thu Feb 18 23:20:39 CET 2010


Brian Marble wrote:
>  
> 
> I am trying to add children nodes to the children of root in a treepanel to
> categorize layers (ie Layers-->Over Layers-->Red Over Layers and Blue Over
> Layers and etc . See ".Node 1.3" and ".Node 1.3.1" in code below. 
> 
>  
> 
> The code below works great except for Node 1.3.1. When I click to show the
> list of layers I get the revolving daisy, forever. I seem to be adding
> children nodes incorrectly.

The only thing that catches my eye is a typo.

In 1.3.1, you have "childNodeType" instead of "nodeType".

Regards,
Andreas.


> 
>  
> 
> What am I missing in my Parent and Children attributes?
> 
>  
> 
> Thanks,
> 
> Brian
> 
>  
> 
> var tree = new Ext.tree.TreePanel({
> 
> .
> 
> root: {
> 
>             nodeType: "async",
> 
>             children: [{
> 
>                                 nodeType: "gx_baselayercontainer",
> 
>                                 text: "Base Layers - Node 1.2",
> 
>                                 expanded: false
> 
>                                 },{
> 
>                                 text: "Over Layers (non gx) - Node 1.3",
> 
>                                 expanded:false,
> 
>                                 childNodeType: "gx_layercontainer",
> 
>                                 children: [{
> 
>                                                 text: "Red Over Layers -
> Node 1.3.1",
> 
>                                                 expanded: false,
> 
>                                                 loader: {
> 
>                                                                 filter:
> function(record) {
> 
>                                                                 var layer =
> record.get("layer");
> 
>                                                                  return
> layer.name.indexOf("Red") !== -1
> 
>                                                 }}},{
> 
>                                                 text: "Blue Over Layers -
> Node 1.3.2",
> 
>                                                 expanded: false,
> 
>                                                 loader: {
> 
>                                                                 filter:
> function(record) {
> 
>                                                                 var layer =
> record.get("layer");
> 
>                                                                  return
> layer.name.indexOf("Blue") !== -1
> 
>                                                 }}}
> 
>                                                 }]
> 
>                                 },{
> 
>                                 text: "MoreLayers - Node 1.4 ",
> 
>                                 nodeType: "gx_layercontainer",
> 
>                                 expanded:false,
> 
>                                 loader: {
> 
>                                                 filter: function(record) {
> 
>                                                 var layer =
> record.get("layer");
> 
>                                                 return
> layer.name.indexOf("MyParameter2") !== -1
> 
>                                                 }}
> 
>                                 },  .
> 
>  
> 
>  
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list