我正在 umbraco 4.8 中创建一个新部分,所以现在我想为该部分创建一个自定义树。这是该部分的寄存器
sortOrder | appAlias | appIcon | appName | appInitWithTreeAlias
9 |importer |import.gif | Importer | NULL
这是该部分的树的寄存器
treeSilent = False
treeInitialize = True
treeSortOrder = 0
appAlias = importer
treeAlias = importer
treeTitle = Importer
treeIconClosed = legacy
treeIconOpen = legacy
treeHandlerAssembly = asm.ssu.importer // My DLL Name
treeHandlerType = site.com.clients.ssu.importer.loadImporter // Namespace.ClassName
actionn = NULL
这是我的课
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using umbraco.cms.presentation.Trees;
namespace site.com.clients.ssu.importer
{
public class loadImporter : BaseTree
{
public loadImporter(String application)
: base(application)
{
}
protected override void CreateRootNode(ref XmlTreeNode rootNode)
{
rootNode.Icon = FolderIcon;
rootNode.OpenIcon = FolderIconOpen;
rootNode.NodeType = TreeAlias;
rootNode.NodeID = "init";
}
public override void RenderJS(ref System.Text.StringBuilder Javascript)
{
Javascript.Append(
@"
function openImporter(id)
{
parent.right.document.location.href = '#' ;
}
");
}
public override void Render(ref XmlTree tree)
{
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = "1";
xNode.Text = "Import Site";
xNode.Icon = "importer.gif";
xNode.Action = "javascript:openImporter(1)";
tree.Add(xNode);
}
}
}
如您所见,我只需要渲染它,但是当我单击该部分并触摸配置时,它应该只渲染一个孩子,但什么也不渲染,知道吗?