任何想法?
解决方案我假设你想以编程方式做这个。看看这个答案 - 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手风琴中打开一个特定的条目吗?
发布评论