如何以编程方式选择sitecore内容树项并展开它?

时间:2010-09-06 11:40:48

标签: sitecore sitecore6

如何以编程方式选择sitecore内容树项并展开它?

Sitecore版本:6.2 通过扩展,我的意思是扩展内容树项,就像在Windows资源管理器(“+”)中一样。

2 个答案:

答案 0 :(得分:2)

好的,我想这段代码会从内容编辑器的某个地方触发,例如单击功能区按钮。那你可能需要这样的东西:

 // it is up to you where to get the item from
 Sitecore.Context.ClientPage.SendMessage(this, string.Concat(new object[] { "item:load(id=", item.ID.ToString(), ")" }));
 Sitecore.Context.ClientPage.SendMessage(this, "item:refreshchildren");

我无法想象您可能需要此功能的情况,但希望这会有所帮助。 :)

答案 1 :(得分:0)

这可能是一个迟到的回复,但您可以通过Sitecore API在<ul>s<li>s内的转发器或列表视图控件中获取所有侧边菜单项,然后使用jQuery插件/ CSS [+]或[ - ]侧边菜单。我已在网站上完成此操作,如果您需要更多信息,我可以向您发送示例