我可以在dojo手风琴中打开一个特定的条目吗?

编程入门 行业动态 更新时间:2024-10-25 06:27:25
本文介绍了我可以在dojo手风琴中打开一个特定的条目吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我想在我应用程序的左侧导航栏中打开一个xPage并选择一个特定的手风琴条目的链接。不确定如何做到这一点

任何想法?

解决方案

我假设你想以编程方式做这个。看看这个答案 - stackoverflow/a/1190455/1047998 - 其中描述了 selectChild ,用于选择特定的手风琴窗格。您还可以浏览dijit.layout.AccordionContainer的Dojo API文档 - http:// dojotoolkit/api/1.6/dijit/layout/AccordionContainer - 您可以参考 selectChild 的文档。

更新:

如果您定义了这样的手风琴容器:

< xp:div dojoType =dijit.layout.AccordionContainerid =accordionContainer> < xp:div dojoType =dijit.layout.ContentPaneid =pane1title =Pane 1> 内容1 < / xp:div> < xp:div dojoType =dijit.layout.ContentPanetitle =Pane 2id =pane2> 内容2 < / xp:div> < xp:div dojoType =dijit.layout.ContentPanetitle =Pane 3id =pane3> 内容3 < / xp:div> < xp:div dojoType =dijit.layout.ContentPanetitle =Pane 4id =pane4> 内容4 < / xp:div> < / xp:div>

所以选择 pane3 JavaScript代码将像:

var ac = dijit.byId(#{id:accordionContainer}); ac.selectChild(dijit.byId(#{id:pane3}));

I want to put links in the left navigation of my application that open an xPage and select a specific accordion entry. Not sure how to do this

Any thoughts?

解决方案

I am assuming here that you want to do this programmatically. Look into this answer- stackoverflow/a/1190455/1047998 - which describes the usage of selectChild which is used to select specific accordion pane. You can also go through the Dojo API documentation of dijit.layout.AccordionContainer - dojotoolkit/api/1.6/dijit/layout/AccordionContainer - where you can refer the documentation for selectChild.

Update:

So let's say if you define your accordion container like this:

<xp:div dojoType="dijit.layout.AccordionContainer" id="accordionContainer"> <xp:div dojoType="dijit.layout.ContentPane" id="pane1" title="Pane 1"> Content 1 </xp:div> <xp:div dojoType="dijit.layout.ContentPane" title="Pane 2" id="pane2"> Content 2 </xp:div> <xp:div dojoType="dijit.layout.ContentPane" title="Pane 3" id="pane3"> Content 3 </xp:div> <xp:div dojoType="dijit.layout.ContentPane" title="Pane 4" id="pane4"> Content 4 </xp:div> </xp:div>

So to select pane3 JavaScript code would be like:

var ac = dijit.byId("#{id:accordionContainer}"); ac.selectChild(dijit.byId("#{id:pane3}"));

更多推荐

我可以在dojo手风琴中打开一个特定的条目吗?

本文发布于:2023-08-07 18:18:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1320847.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:手风琴   条目   dojo

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!