Dear Matt, <br><br>Hmm this seems like this might be a way for me to go..yet one thing that has me puzzled is that if I declare my layer to have displayInLayerSwitcher: false, shouldn&#39;t it be that this layer does not append a node to the containers?  I was just trying to avoid having to have each and every layer container filter out this one layer, other than that I am actually having troubles filtering out the layer itself :p<br>
<br>loader:{<br>                filter: function(record) {<br>                   //From GeoExt examples...<br>                    //return record.get(&quot;layer&quot;).name.indexOf(&quot;Tasmania&quot;) !== -1<br>                   //my attempt<br>
                    return record.get(&quot;layer&quot;).name != &#39;Photos&#39;; // :( not working<br>                }<br>            } <br><br>Thanks,<br><br>elshae<br><br><div class="gmail_quote">On Mon, Nov 29, 2010 at 2:25 PM, Matt Priour <span dir="ltr">&lt;<a href="mailto:mpriour@kestrelcomputer.com">mpriour@kestrelcomputer.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



<div style="padding-right: 10px; padding-left: 10px; padding-top: 15px;" name="Compose message area">
<div><font size="2" face="Arial">What you want to do is to create your layer with 
some attribute that you are filtering for when creating its 
parent LayerContainerNode. This way when you add it to the map it is either 
added to the correct parent node because it is filtered out of the other layer 
container nodes filter function or it is not added to any nodes until you 
manually call the load method on the parent LayerContainerNode. (I just haven&#39;t 
looked at the code to know if the layertree is automatically updated or if you 
have to call load)</font></div>
<div><font size="2" face="Arial">Either way, the filter function parameter of the 
loader is what will get you your layer added to the correct parent 
node</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Matt Priour</font></div>
<div style="font: 10pt Tahoma;">
<div><font face="Arial"></font><font face="Arial"></font><font face="Arial"></font><br></div>
<div style="background: none repeat scroll 0% 0% rgb(245, 245, 245);">
<div><b>From:</b> <a title="itintern12@gmail.com" href="mailto:itintern12@gmail.com" target="_blank">IT Intern</a> </div>
<div><b>Sent:</b> Monday, November 29, 2010 12:38 PM</div>
<div><b>To:</b> <a title="Users@geoext.org" href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a> </div>
<div><b>Subject:</b> Re: [Users] Dynamic Node does not bind to 
layer</div></div></div><div><div></div><div class="h5">
<div><font size="2" face="Arial"></font><font size="2" face="Arial"></font><br></div>Dear Matt,<br><br>Thanks for your feedback!  
Unfortunately I have tried that and I still have a little problem :-/.  
When I remove the additional listener everything works great, except every layer 
container on my tree now has a node for this layer which is not what I want 
:(.  I need a way that I append a single node to a single layer container 
...<br><br>Thank you,<br><br>elshae<br><br>
<div class="gmail_quote">On Mon, Nov 29, 2010 at 1:33 PM, Matt Priour <span dir="ltr">&lt;<a href="mailto:mpriour@kestrelcomputer.com" target="_blank">mpriour@kestrelcomputer.com</a>&gt;</span> 
wrote:<br>
<blockquote class="gmail_quote" style="padding-left: 1ex; margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);">
  <div style="padding-right: 10px; padding-left: 10px; padding-top: 15px;" name="Compose message area">
  <div><font size="2" face="Arial">The LayerStore associtated with the map already 
  has register listeners in the map to take care of adding layers to itself when 
  you add them to the map or vice versa.</font></div>
  <div><font size="2" face="Arial">Remove the additional listener that you are 
  adding and things should work much better.</font></div>
  <div><font size="2" face="Arial"></font> </div>
  <div><font size="2" face="Arial">Matt Priour</font></div>
  <div style="font: 10pt Tahoma;">
  <div><font face="Arial"></font><font face="Arial"></font><br></div>
  <div style="background: none repeat scroll 0% 0% rgb(245, 245, 245);">
  <div><b>From:</b> <a title="itintern12@gmail.com" href="mailto:itintern12@gmail.com" target="_blank">IT Intern</a> </div>
  <div><b>Sent:</b> Monday, November 29, 2010 12:28 PM</div>
  <div><b>To:</b> <a title="users@geoext.org" href="mailto:users@geoext.org" target="_blank">users@geoext.org</a> </div>
  <div><b>Subject:</b> [Users] Dynamic Node does not bind to 
  layer</div></div></div>
  <div>
  <div></div>
  <div>
  <div><font size="2" face="Arial"></font><font size="2" face="Arial"></font><br></div>Hello GeoExt list,<br><br>I have a tree panel which I 
  append a child node to after it has been created.  The node appears, but 
  when it is toggled on and off I get the error in firebug:<br><br>
  <div><span></span>this.node.getOwnerTree() is null</div><span></span>
  <div><img src="" title="Break on this error"><a> var checkedNodes = 
  this.node.getOwnerTree().getChecked();<br><br>Also the layer does not appear 
  on and off as the node is toggled.  I have tried several things, last 
  thing I tried is listening to the event of where the map has added the layer 
  and then adding the layer to the layer store and creating the node and 
  appending it to the root node of the tree panel.  Please if anyone knows 
  why this is failing please drop me a hint 
  :)<br><br>Thanks,<br><br>elshae<br><br></a></div>    
  <br>    map.events.register(&quot;addlayer&quot;, this, function() 
  {<br>        var l = 
  map.layers[map.layers.length-1];<br>        
  layerStore.loadData([l], true);<br>        
  var className = &#39;&#39;;<br>        if 
  (l.isBaseLayer || !l.displayInLayerSwitcher) 
  {<br>            
  className = &#39;x-hidden&#39;;<br>        
  }<br>      
  <br>        var node = new 
  GeoExt.tree.LayerNode({<br>        
      layerStore: 
  layerStore,<br>            
  layer: l,<br>            
  checkedGroup: &#39;foo&#39;,<br>        
      checked: false<br>        
  });<br>        // todo, depends on 
  ascending whether to use insertBefore or 
  appendChild<br>        
  //this.getRootNode().insertBefore(node, this.getRootNode().firstChild); 
  <br>        
  layerRoot.getOwnerTree().getNodeById(&#39;photos&#39;).appendChild(node);<br>        
  });<br><br>map.addLayer(vectorPano);<br></div></div>
  <p></p>
  <hr>

  <p></p>_______________________________________________<br>Users mailing 
  list<br><a href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a><br><a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
</div></blockquote></div><br>
<p>
</p><hr>

<p></p>_______________________________________________<br>Users mailing 
list<br><a href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a><br><a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></div>
</blockquote></div><br>