[Dojo-interest] .AccordionContainer :: How do I specify which pane to display when the accordion is loaded?

1 view
Skip to first unread message

curly_bracket

unread,
Apr 16, 2011, 1:03:44 PM4/16/11
to dojo-i...@mail.dojotoolkit.org
Hey smart folks!

How do I specify which pane to display when the accordion is loaded?

Tech Specs:
Declarative programming

Background Info:
On the dijit documentation page, it says the first pane will open by default
unless I specify differently. However, the example accordion widgets
display the second pane upon load - and I don't see where that was declared
in the code.
http://dojotoolkit.org/reference-guide/dijit/layout/AccordionContainer.html
.AccordionContainer documentation


--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/AccordionContainer-How-do-I-specify-which-pane-to-display-when-the-accordion-is-loaded-tp2828339p2828339.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
Dojo-i...@mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Karl Tiedt

unread,
Apr 16, 2011, 1:36:18 PM4/16/11
to dojo-i...@mail.dojotoolkit.org
Here you go

<div dojoType="dijit.layout.ContentPane" title="This is as well"
selected="true"> <--- selected.....

-Karl Tiedt

Ted Scott

unread,
Apr 16, 2011, 1:48:42 PM4/16/11
to dojo-i...@mail.dojotoolkit.org
Accordian.selectChild(dijit.byId("the_id_you_want_displayed")) Oh wait,
sorry, that's not declarative.

The attribute selected='true' should work on the child you want to be
shown, or add that one last.

There is gold in the JSDocs on what is available on any given widget.

curly_bracket

unread,
Apr 17, 2011, 5:55:38 PM4/17/11
to dojo-i...@mail.dojotoolkit.org
Thanks Karl and Ted.

Regrettably, Ted, there's nothing in the JSDocs about how to simply put
selected="true"... it's a glaring omission isn't it? I do see how the HTML
source code identifies the open pane with selected="true". Still, it would
be helpful for Dojo newbies to find that documented somewhere.

Here's the page I'm referring to:
http://dojotoolkit.org/reference-guide/dijit/layout/AccordionContainer.html

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/AccordionContainer-How-do-I-specify-which-pane-to-display-when-the-accordion-is-loaded-tp2828339p2832307.html

Ted Scott

unread,
Apr 17, 2011, 10:29:53 PM4/17/11
to dojo-i...@mail.dojotoolkit.org
Maybe there could be a more explicit link, but if you consider that the
declarative form of instantiation of a digit still uses the underlying
classes in the libraries, then assuming that people know to go to the JS
Docs to see the supported attributes and methods is reasonable. All of
the docs work like that.

The JS Docs link is at the top of the page you cite.
http://dojotoolkit.org/api/dijit.layout.AccordionContainer I don't know,
but I suspect that the examples are kept simple for a reason.

IIRC, Dojo is open source, so if you have patches to correct glaring
omissions in the documentation, I'm sure there's some process for you to
submit it, and it will be welcomed.

Kenneth G. Franqueiro

unread,
Apr 18, 2011, 12:26:28 AM4/18/11
to dojo-i...@mail.dojotoolkit.org
It is certainly mentioned in the API doc here:
http://dojotoolkit.org/api/dijit/layout/AccordionContainer/selected

Granted, that's not necessarily going to be readily apparent. I notice
there's also a slight mention of it in TabContainer's reference-guide
page (though it's actually a feature of StackContainer, from which both
TabContainer and AccordionContainer inherit):
http://dojotoolkit.org/reference-guide/dijit/layout/TabContainer.html#selecting-another-tab

RE contributing patches/docs, if one is so inclined:

The API docs are generated from specifically-formatted comments in the
source code; a patch to this ought to be submitted via
http://bugs.dojotoolkit.org

The reference-guide is generated at each release from the wiki at
http://docs.dojocampus.org (note that this is a wiki, and therefore is
apt to have some documentation of features present only in trunk).

You can get an account for both of these at http://my.dojofoundation.org

Note that a signed contributor's license agreement (CLA) is generally
required for acceptance of non-trivial changes/additions. See
http://dojofoundation.org/about/cla (there's also a broader explanation
at http://dojotoolkit.org/get-involved).

--Ken

Reply all
Reply to author
Forward
0 new messages