<div dir="ltr">Hello all,<div><br></div><div>I'm trying to build a layer tree in MVC application. I'm trying to manually set the tree nodes and not to use the map to store option. In the following code, layers is an array of OpenLayers.Layer objects that have displayInLayerSwitcher set to true.</div>
<div><br></div><div><div>var store = Ext.create('GeoExt.data.LayerStore', {</div><div> map: map,</div><div> initDir: 0,</div><div> layers: layers</div><div>});</div><div><br></div><div>var loader = Ext.create('GeoExt.tree.LayerLoader', {</div>
<div> store: store</div><div>});</div><div><br></div><div>var container = Ext.create('GeoExt.tree.BaseLayerContainer', {</div><div> text: 'Arruamentos',</div><div> expanded: true,</div><div> loader: loader</div>
<div>});</div></div><div><br></div><div>After this i'm manually appending the container to the tree root node. In the layer tree i get the parent node to be displayed (which is in fact the container) but i have no child nodes.</div>
<div><br></div><div><div>My tree view is defined as follows:</div><div><br></div><div><div>Ext.define('labnt.view.TocPanel', {</div><div> extend: 'GeoExt.tree.Panel',</div><div> alias: 'widget.tocPanel',</div>
<div> title: 'TOC',</div><div> iconCls: 'tocPanel-icon',</div><div> rootVisible: false,</div><div> initComponent: function(){</div><div> this.callParent();</div><div> }</div><div>});</div>
</div><div><br></div><div>Any help would be very much appreciated :)</div><div><br></div><div>Kind regards,</div><div><br></div>-- <br>Hugo Martins<br>
</div></div>