Bitwyse1
Bitwyse1

Reputation: 339

Can I open a specific entry in a dojo accordion?

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?

Upvotes: 2

Views: 1830

Answers (1)

Naveen
Naveen

Reputation: 6936

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

Upvotes: 2

Related Questions