[Users] Turning treepanel legend items into hyperlinks.
Eric Lemoine
eric.lemoine at camptocamp.com
Wed May 12 09:41:08 CEST 2010
On Wed, May 12, 2010 at 7:50 AM, Andreas Hocevar <ahocevar at opengeo.org> wrote:
> 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.
Your solution is indeed better. Thanks Andreas.
One issue is that createNode receives a layer as opposed to a layer
record, so when overriding createNode one will need to find the layer
record corresponding to the layer. We could change the code so
createNode receives a layer record. We could also change LayerNode so
it can be configured with a layer record; currently the "layer" option
can reference a layer or a layer name, so we could extend this so it
can also reference a 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 : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list