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 class="errorTitle focusRow
subLogRow "><span class="errorDuplication "></span>this.node.getOwnerTree()
is null</div><span class=" "></span><div class="errorSourceBox
errorSource-show focusRow subLogRow "><img src="chrome://firebug/content/blank.gif" title="Break on this error" class="errorBreak
a11yFocus "><a class="errorSource a11yFocus "> 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("addlayer", this, function() {<br> var l = map.layers[map.layers.length-1];<br> layerStore.loadData([l], true);<br> var className = '';<br>
if (l.isBaseLayer || !l.displayInLayerSwitcher) {<br> className = 'x-hidden';<br> }<br> <br> var node = new GeoExt.tree.LayerNode({<br> layerStore: layerStore,<br> layer: l,<br>
checkedGroup: 'foo',<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('photos').appendChild(node);<br> });<br><br>map.addLayer(vectorPano);<br>