如何确定当前选择了哪个 dijit.layout.AccordionPane

发布于 2024-09-01 12:29:43 字数 363 浏览 6 评论 0原文

我尝试使用“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱格式化 2024-09-08 12:29:43

您应该使用包含所有这三个 dijit.layout.AccordionPanedijit.layout.AccordionContainer 来确定当前选择的是哪一个。

您可以使用dijit.layout.AccordionContainer的属性selectedChildWidget来获取当前选定的dijit.layout.AccordionPane

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.

挽手叙旧 2024-09-08 12:29:43

AccordionPane 封装在 AccordionContainer 中。 AccordionContainer 扩展 StackContainer 它使用 Dojo 的 pub-sub 通信通道在选择窗格时进行通告。订阅主题 [widgetId]-selectChild 以在每次选择新窗格时收到通知。 [widgetId] 是容器元素的小部件 ID。

dojo.subscribe("[widgetId]-selectChild", function(pane){
    console.log("A new pane was selected:", pane);
});

AccordionPanes are wrapped within an AccordionContainer. The AccordionContainer extends StackContainer 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.

dojo.subscribe("[widgetId]-selectChild", function(pane){
    console.log("A new pane was selected:", pane);
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文