Hi Matt,

 

I'm trying to follow your suggestions but I didn't get success.

 

My code:

 

new Ext.Viewport({

    layout: "border",

                ...

    items: [{

                                               region: "center",

                                               xtype: "gx_mappanel",

                                               id: "mappanel",

                                               map: map,

                                               layers: layerStore,

                                               zoom: 11,

                               },{

                                               region: "west",

            id: 'west-panel',

            layout: 'accordion',

                                               defaults: {

                                                               // applied to 
each contained panel

                                                               bodyStyle: 
'padding:5px'

                                               },

            layoutConfig:{

                animate: true

            },

           items: [{

                                                               title: capes,

                                                               id: 'lyrsTree',

                            xtype: "treepanel",

                            loader: new Ext.tree.TreeLoader({

                                applyLoader: false

                            }),

                                                               rootVisible: 
false,

                                                               autoScroll: true,

                            root: {

                                                                              
children: createChildren()

                            }

                                               },{

....

 

var createChildren = function(){

return [{

},{

"nodeType": "gx_layer",

                "id": "tpnOrto",

                "layer": "topoorto",

                "qtip": tooltipTopoorto,

                "text": lyrTopoorto,

                "icon": ""

},{

 

....

 

var foo = Ext.getCmp('lyrsTree');

var foo2 = kk.getNodeById('tpnOrto');

 

foo2 = undefined

 

Any idea or example how to get reference to the node directly or tree?

 

Thanks in advance.

 

 

Antoni Vidal

Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya 
<http://mercuri.icc.cat/website/mob_nf/mob1/mob2/inici2.htm?CONSULTA=Institut%20Cartogr%25E0fic%20de%20Catalunya&XYADDRESS=429486:4580392>
 
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat <http://www.icc.cat/> 

 

 

 

De: Matt Priour [mailto:[email protected]] 
Enviat: lunes, 11 de abril de 2011 18:12
Per a: Vidal, Antoni; [email protected]
Tema: Re: [Users] How to get node from asynctreenode

 

I don't see where you are defining any component with an id or 'tpnOrto'. Also 
when trying to retrieve nodes, it is better to use one of the node retrival 
methods rather than Ext.getCmp. I would suggest using either 
Ext.TreePanel.getNodeById, Ext.Node.findChild, or Ext.Node.findChildBy

 

Hope that helps.

 

Matt Priour

Kestrel Computer Consulting

 

From: Vidal, Antoni <mailto:[email protected]>  

Sent: Monday, April 11, 2011 6:31 AM

To: [email protected] 

Subject: [Users] How to get node from asynctreenode

 

Hello list,

 

I would like to get a node from asynctreenode but I only get "undefined" and I 
can't use disable() function.

 

My code:

 

....

},{

    "nodeType": "gx_layer",

    "id": "toponimOrto",

    "layer": "topoorto",

    "text": "Toponimy"

},{

 

....

var foo = Ext.getCmp('tpnOrto');

console.info(foo);

 

Any suggestion?

 

Thank's in advance.

 

Antoni Vidal

Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya 
<http://mercuri.icc.cat/website/mob_nf/mob1/mob2/inici2.htm?CONSULTA=Institut%20Cartogr%25E0fic%20de%20Catalunya&XYADDRESS=429486:4580392>
 
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat <http://www.icc.cat/> 

 

________________________________

_______________________________________________
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

Reply via email to