ExtJS 4 - 获取 Ext.toolbar 的溢出菜单

发布于 2024-12-20 13:57:09 字数 336 浏览 2 评论 0原文

有没有办法在具有 enableOverflow:true 的 Ext.toolbar 上获取分别用于溢出菜单和“更多按钮”的 Ext.menu 和/或 Ext.Button 组件?

我尝试将侦听器附加到工具栏的 overflowchange 事件,看看是否可以使用 query()getComponent() 来查找按钮/菜单当它被显示时,但是当调整工具栏大小以导致溢出菜单出现/消失时,该事件似乎不会触发。我还监视了工具栏的 add 事件,以查看当“更多”按钮添加到工具栏时是否触发该事件,但也没有运气。

Is there a way to get the Ext.menu and/or the Ext.Button components used for the overflow menu and "more button" respectively on a Ext.toolbar that has enableOverflow:true?

I tried attaching a listener to the toolbar's overflowchange event to see if I could use query() or getComponent() to find the button/menu when it was being shown, but that event does not seem to fire when resizing the toolbar to cause the overflow menu to appear/disappear. I also monitored the toolbar's add event to see if that was fired when the "more" button was added to the toolbar, but no luck there either.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

旧人九事 2024-12-27 13:57:09

在 Sencha 论坛的帮助下弄清楚了:
http://www.sencha.com /forum/showthread.php?160597-Getting-a-toolbar-s-overflow-menu

溢出菜单组件位于:
toolbar.layout.overflowHandler.menu

但请注意,overflowHandlermenu 属性仅在实际需要菜单时才出现。

Figured it out, with help from the Sencha Forums:
http://www.sencha.com/forum/showthread.php?160597-Getting-a-toolbar-s-overflow-menu

The overflow menu component resides in:
toolbar.layout.overflowHandler.menu

Be care though, the menu property of overflowHandler is only present when the menu is actually needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文