开发者

How can I programatically select a sitecore content tree item and expand it?

How can I开发者_StackOverflow中文版 programatically select a sitecore content tree item and expand it ?

Sitecore version: 6.2 By expanding, I mean expanding the content tree item like in windows explorer ("+").


Ok, I suppose this code will be triggered from somewhere in Content Editor, e.g. by clicking the ribbon button. Then you might need something like this:

 // 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");

I can't imagine the scenario when you might need this functionality, but hope this helps. :)


this might be a late reply but you can get all the side menu items via Sitecore API in a repeater or listview control within <ul>s and <li>s and then use a jQuery plug-in/CSS to [+] or [-] the side menu. I have done this on a site, if you need more information I can send you an example

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜