<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi,<br>
<br>
Any luck if you try the following?<br>
<pre wrap=""> createNode: function(attr) {
attr.icon = <a class="moz-txt-link-rfc2396E" href="http://localhost/WebServices/Request.aspx?request=GetLegendGraphic&version=1.1.1&format=image/png&style=&layer=">"http://localhost/WebServices/Request.aspx?request=GetLegendGraphic&version=1.1.1&format=image/png&style=&layer="</a>+attr.text
//alert(attr.icon);
        <b>return new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr);</b>
//return GeoExt.tree.LayerParamLoader.prototype.createNode.apply(this, arguments);
}</pre>
<br>
<br>
On 24/11/2010 17:02, Andrew Stewart wrote:
<blockquote
cite="mid:94816848A8EB3941B1E8592F425827A981DC41847D@chex2.crdnet.ca"
type="cite">
<pre wrap="">Hi Andreas for your suggestion. I am still having some difficulties with the parameters for this.. Except when I issue the same request in my browser I am getting the correct legend graphic returned but when I run it through the code I am getting nothing showing up.
I modified my code to this -
//Labels layerlist
layerList_Labels = new GeoExt.tree.LayerNode({
"layer": layer_Labels,
"isLeaf": true,
"checked": false,
"enableDD": true,
"cls": "rootnode",
"singleClickExpand": true,
"listeners":
{
'checkchange' : function(node, checked)
{
// If a parent node is unchecked, uncheck all the children
if (node.getUI().isChecked()) {
node.expand();
}
if (!node.getUI().isChecked())
{
node.collapse();
}
}
},
loader: {
param: "LAYERS",
createNode: function(attr) {
attr.icon = <a class="moz-txt-link-rfc2396E" href="http://localhost/WebServices/Request.aspx?request=GetLegendGraphic&version=1.1.1&format=image/png&style=&layer=">"http://localhost/WebServices/Request.aspx?request=GetLegendGraphic&version=1.1.1&format=image/png&style=&layer="</a>+attr.text
alert(attr.icon);
return GeoExt.tree.LayerParamLoader.prototype.createNode.apply(this, arguments);
}
}
});
And nothing shows up.. However if I copy the url of attr.icon and paste this in my browser I do see the correct legend graphic for the legend entry. Should I change this around because my childnodes are not expanded first on initial load? I have also tried to add the style= and it didn't seem to have any affect or make it stop working either. Thanks again for the help.
</pre>
</blockquote>
</body>
</html>