Hello Aleandre,<div><br></div><div>I skipped for the moment MVC approach, as soon as I get more experience with extjs then will try again. So, yes, I solved it, thank you</div><div><br></div><div>Antonio<br clear="all">- Antonio<br>

<br><br><div class="gmail_quote">On 5 December 2012 15:59, Alexandre Dubé <span dir="ltr">&lt;<a href="mailto:adube@mapgears.com" target="_blank">adube@mapgears.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Hi Antonio,<br>
      <br>
        Sorry for the late answer.  Were you able to solve your issue ?<br>
      <br>
      Alexandre<div><div class="h5"><br>
      <br>
      <br>
      On 12-11-19 07:58 PM, Antonio Parrotta wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">Hi,
      <div><br>
      </div>
      <div>I&#39;m trying to merge MVC simple (<i><a href="http://geoext.github.com/geoext2/examples/app/simple/simple.html" target="_blank">http://geoext.github.com/geoext2/examples/app/simple/simple.html</a></i>)
        and tree (<i><a href="http://geoext.github.com/geoext2/examples/tree/tree.html" target="_blank">http://geoext.github.com/geoext2/examples/tree/tree.html</a></i>)
        examples . I created a new east panel in the viewport and a
        Layer.js store as reported below. The problem here is that at
        the time <i>CF.store.Layers</i> is defined, map controller is
        not yet initialized, then <i><b>mapPanel.layers</b></i>:is
        undefined. Do you know how to postpone the store creation after
        the map initialization?</div>
      <div><br>
      </div>
      <div>thanks a lot</div>
      <div>Antonio</div>
      <div><br>
      </div>
      <div><b>Layer Store</b></div>
      <div><br>
      </div>
      <div>
        <div><i>Ext.define(&#39;CF.store.Layers&#39;, {</i></div>
        <div><i>    extend: &#39;Ext.data.TreeStore&#39;,</i></div>
        <div><i>    model: &#39;GeoExt.data.LayerTreeModel&#39;,</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>root:
            {</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>expanded:
            true,</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>children:
            [</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>{</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>plugins:
            [{</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>ptype:
            &#39;gx_layercontainer&#39;,</i></div>
        <div><i><span style="white-space:pre-wrap"> </span><b>store:
              mapPanel.layers</b><span style="white-space:pre-wrap"> </span></i></div>
        <div><i><span style="white-space:pre-wrap"> </span>}],</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>expanded:
            true</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>},
            {</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>plugins:
            [&#39;gx_baselayercontainer&#39;],</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>expanded:
            true,</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>text:
            &quot;Base Maps&quot;</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>},
            {</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>plugins:
            [&#39;gx_overlaylayercontainer&#39;],</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>expanded:
            true</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>}</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>]</i></div>
        <div><i><span style="white-space:pre-wrap"> </span>}<span style="white-space:pre-wrap"> </span></i></div>
        <div><i>});</i></div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><b>East Panel</b></div>
        <div>
          <br>
        </div>
        <div>
          <div><i>items: [</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>Ext.create(&#39;GeoExt.tree.Panel&#39;, {</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>region: &quot;east&quot;,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>border: true,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>title: &quot;Layers&quot;,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>width: 200,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>split: true,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>collapsible: true,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>collapseMode: &quot;mini&quot;,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>autoScroll: true,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span><b>store: &#39;Layers&#39;,</b></i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>root: {</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>text: &#39;root node&#39;</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>},<span style="white-space:pre-wrap"> </span></i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>rootVisible: false,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>lines: false,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>tbar: [{</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>text: &quot;remove&quot;,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>handler: function() {</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>layer = mapPanel.map.layers[2];</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>mapPanel.map.removeLayer(layer);</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>}</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>}, {</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>text: &quot;add&quot;,</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>handler: function() {</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>mapPanel.map.addLayer(layer);</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>}</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>}]</i></div>
          <div><i><span style="white-space:pre-wrap">
              </span>})</i></div>
        </div>
        <div><i>]</i></div>
        - Antonio<br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
Users mailing list
<a href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <br>
    <pre cols="72">-- 
Alexandre Dubé
Mapgears
<a href="http://www.mapgears.com" target="_blank">www.mapgears.com</a>
</pre>
  </font></span></div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">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>
<br></blockquote></div><br></div>