我可以在dojo手风琴中打开一个特定的条目吗? [英] Can I open a specific entry in a dojo accordion?

查看:120
本文介绍了我可以在dojo手风琴中打开一个特定的条目吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我应用程序的左侧导航栏中打开一个xPage并选择一个特定的手风琴条目的链接。不确定如何做到这一点



任何想法?

解决方案

我假设你想以编程方式做这个。看看这个答案 - https://stackoverflow.com/a/1190455/1047998 - 其中描述了 selectChild ,用于选择特定的手风琴窗格。您还可以浏览dijit.layout.AccordionContainer的Dojo API文档 - http:// dojotoolkit.org/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- https://stackoverflow.com/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 - http://dojotoolkit.org/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手风琴中打开一个特定的条目吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆