Jan 15, 2009, 3:28 PM
[CLOSED] TreeNode Icon
I have a BinderPanel on my default page and I'm adding another folder to the tree via the IFrame in the center auf the default page.
To add the folder without reloading the tree, I use:
Thanks,
Sharon
To add the folder without reloading the tree, I use:
string parentId = parentBinder.ParentObject.Id + "!" + parentBinder.Id;
string nodeId = parentBinder.Id + "!" + binder.Id;
string nodeName = binder.Name;
ScriptManager2.AddScript("AddBinder('" + parentId + "', '" + nodeId + "', '" + nodeName + "');");
The javascript code is: function AddBinder(parentNodeId, nodeId, nodeName) {
var parentNode = parent.window.BinderTree.getNodeById(parentNodeId);
var node = new Ext.tree.AsyncTreeNode({
id: nodeId,
text: nodeName,
leaf: false,
iconCls: 'folder-create'
});
if (parentNode != null) {
parentNode.expand();
parentNode.appendChild(node);
}
}
And the css is: .folder-create .x-tree-node-icon
{
background: transparent url(/icons/folder-png/coolite.axd) no-repeat;
}
I have no idea why but the created treenode always has the default icon for folders. What am I doing wrong?Thanks,
Sharon