Hello Aleandre, 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
Antonio - Antonio On 5 December 2012 15:59, Alexandre Dubé <[email protected]> wrote: > Hi Antonio, > > Sorry for the late answer. Were you able to solve your issue ? > > Alexandre > > > > On 12-11-19 07:58 PM, Antonio Parrotta wrote: > > Hi, > > I'm trying to merge MVC simple (* > http://geoext.github.com/geoext2/examples/app/simple/simple.html*) and > tree (*http://geoext.github.com/geoext2/examples/tree/tree.html*) > 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 *CF.store.Layers* is > defined, map controller is not yet initialized, then *mapPanel.layers*:is > undefined. Do you know how to postpone the store creation after the map > initialization? > > thanks a lot > Antonio > > *Layer Store* > > *Ext.define('CF.store.Layers', {* > * extend: 'Ext.data.TreeStore',* > * model: 'GeoExt.data.LayerTreeModel',* > * root: {* > * expanded: true,* > * children: [* > * {* > * plugins: [{* > * ptype: 'gx_layercontainer',* > * store: mapPanel.layers * > * }],* > * expanded: true* > * }, {* > * plugins: ['gx_baselayercontainer'],* > * expanded: true,* > * text: "Base Maps"* > * }, {* > * plugins: ['gx_overlaylayercontainer'],* > * expanded: true* > * }* > * ]* > * } * > *});* > > > *East Panel* > > *items: [* > * Ext.create('GeoExt.tree.Panel', {* > * region: "east",* > * border: true,* > * title: "Layers",* > * width: 200,* > * split: true,* > * collapsible: true,* > * collapseMode: "mini",* > * autoScroll: true,* > * store: 'Layers',* > * root: {* > * text: 'root node'* > * }, * > * rootVisible: false,* > * lines: false,* > * tbar: [{* > * text: "remove",* > * handler: function() {* > * layer = mapPanel.map.layers[2];* > * mapPanel.map.removeLayer(layer);* > * }* > * }, {* > * text: "add",* > * handler: function() {* > * mapPanel.map.addLayer(layer);* > * }* > * }]* > * })* > *]* > - Antonio > > > _______________________________________________ > Users mailing > [email protected]http://www.geoext.org/cgi-bin/mailman/listinfo/users > > > > -- > Alexandre Dubé > Mapgearswww.mapgears.com > > > _______________________________________________ > Users mailing list > [email protected] > http://www.geoext.org/cgi-bin/mailman/listinfo/users > >
_______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
