如何确定当前选择了哪个 dijit.layout.AccordionPane
我尝试使用“dijit.layout.AccordionPane.selected”来确定是否有任何给定的 AccordionPane 处于焦点(选定)。但是,一旦选择了 AccordionPane,AccordionPane.selected 属性将设置为“True”,并且即使选择了其他 dijit.layout.AccordionPane,AccordionPane.selected 也会保持为“True”。 换句话说,如果我有 3 个 AccordionPanes,在单击所有 3 个之后,所有 3 个的 AccordionPane.selected 属性现在都是“True”。 这是一个错误,还是有其他方法可以确定当前选择哪个 AccordionPane(焦点)? 提前致谢!
大卫
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该使用包含所有这三个
dijit.layout.AccordionPane
的dijit.layout.AccordionContainer
来确定当前选择的是哪一个。您可以使用
dijit.layout.AccordionContainer
的属性selectedChildWidget
来获取当前选定的dijit.layout.AccordionPane
。You should use the
dijit.layout.AccordionContainer
that contains all these threedijit.layout.AccordionPane
to determine which one is currently selected.You can use
dijit.layout.AccordionContainer
's propertyselectedChildWidget
to get current selecteddijit.layout.AccordionPane
.AccordionPane
封装在AccordionContainer
中。AccordionContainer
扩展StackContainer 它使用 Dojo 的 pub-sub 通信通道
在选择窗格时进行通告。订阅主题
[widgetId]-selectChild
以在每次选择新窗格时收到通知。[widgetId]
是容器元素的小部件 ID。AccordionPane
s are wrapped within anAccordionContainer
. TheAccordionContainer
extendsStackContainer
which uses Dojo's pub-sub communication channel to advertise when a pane was selected. Subscribe to topic[widgetId]-selectChild
to get notified every time when a new pane is selected.[widgetId]
is the widget ID of the container element.