Search code examples
dojoaccordionpane

How to determine which dijit.layout.AccordionPane is currently selected


I tried to use "dijit.layout.AccordionPane.selected" to determine if any given AccordionPane is in focus (selected). However, AccordionPane.selected property will be set to "True" once the AccordionPane is selected, and AccordionPane.selected stays as "True" even other dijit.layout.AccordionPane is selected. So in other words, if I have 3 AccordionPanes, after I clicked on all 3 of them, AccordionPane.selected property for all 3 of them are "True" now. Is this a bug, or there is other ways to determine which AccordionPane is currently being selected (in focus)? Thanks in advance!

David


Solution

  • You should use the dijit.layout.AccordionContainer that contains all these three dijit.layout.AccordionPane to determine which one is currently selected.

    You can use dijit.layout.AccordionContainer's property selectedChildWidget to get current selected dijit.layout.AccordionPane.