[Users] Adding legend image to tree panel?

Jason Woolard jason.woolard at noaa.gov
Sat Jul 28 22:46:54 CEST 2012


Hi,

Is it possible to use gx_legendimage within a tree config? I'd like to just
add a single static legend graphic below a layer in the tree.
This is what I was unsuccessfully trying.

    var treeConfig = [

         { nodeType: "gx_baselayercontainer",
           text: 'Base Layers',
           expanded: false,
           loader: {
                      filter: function(rec) {
                             return (rec.get("layer").options.group ==
"baselyrs");
                   }
           }
        },
        { nodeType: "gx_layercontainer",
          text: 'Vector',
          expanded: true,
          loader: {
                  filter: function(rec){
                        return (rec.get('layer').options.group ==
"veclyrs");
                  },
                  baseAttrs: {
                      uiProvider: "custom_ui"
                  },
                  createNode: function(attr) {

                    attr.component = {
                        xtype: "gx_legendimage",
                        defaultImgSrc: "image1.JPG",
                        url: "image1.JPG"
                   }
                  return
GeoExt.tree.LayerLoader.prototype.createNode.call(this, attr);

                }

           }
     }.......More Layers]

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120728/dc93e728/attachment.htm 


More information about the Users mailing list