Ext tree loaders are pretty extensible, and the loaders we have are no 
exception.

The most elegant way, as Eric already pointed out, is to store the href 
somewhere, e.g. in the LayerStore. But there is no need to override a 
constructor or render method. The loader's createNode method is the one exposed 
to the API, and this is what you should override. See 
http://www.extjs.com/deploy/dev/docs/?class=Ext.tree.TreeLoader and look for 
the createNode method for an example.

Regards,
Andreas.

On May 12, 2010, at 08:16 , Eric Lemoine wrote:

> On Wednesday, May 12, 2010, Phil Scadden <[email protected]> wrote:
>> I notice that Ext tree nodes which is what items in a treepanel layer
>> list consist of are hyperlinks with an href properties. I would like to
>> use that to link to metadata about a layer but how do I load this data
>> into it with the loader? Seems it should be something in the layerstore
>> but it has me scratching my head.
> 
> Where are the hrefs stored? In the layer records?
> 
> I think what would do is extend the LayerNode class and overload the
> constructor (or maybe the render method) to set "href" in the node
> based on some value read from the layer record or the layer (depending
> on where you store hrefs). You'd also need to define your own node
> type for this class:
> 
> Ext.tree.TreePanel.nodeTypes.customnodetype = CustomLayerNode;
> 
> I'm not sure this is the best way, and I'd like to hear from Andreas
> or others about this.
> 
> Also, I think we could introduce a generic mechanism where the
> LayerNode constructor (or render function) applies to the node what's
> in the layer record.
> 
> Cheers,
> 
> -- 
> Eric Lemoine
> 
> Camptocamp France SAS
> Savoie Technolac, BP 352
> 73377 Le Bourget du Lac, Cedex
> 
> Tel : 00 33 4 79 44 44 96
> Mail : [email protected]
> http://www.camptocamp.com
> _______________________________________________
> Users mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to