访问 SegmentedButton 按钮以更改 Sencha 中的徽章

发布于 2024-10-06 17:14:49 字数 131 浏览 0 评论 0原文

我已经声明了一个名为“myseg”的新 Ext.SegmentedButton(),其中包含几个项目...在另一个函数中,我想访问“myseg”中每个按钮的徽章并更改值...我该如何做想做那件事吗?如何通过“myseg”访问“buttons”集合?

I've declared a new Ext.SegmentedButton() called "myseg" with a couple of items... In a another function i want to access the badges of each button in "myseg" and change the values... how do I got about doing that? How can I access the "buttons" collection via "myseg" ?

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

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

发布评论

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

评论(1

你是暖光i 2024-10-13 17:14:49

还没有完全测试我自己的答案,但我相信它应该通过以下方式完成:

Ext.ComponentQuery.query();

如果假设您这样做,则此方法应该返回按钮组件:

var buttons = myseg.query('button); // return an array of components

然后循环......

buttons.forEach(function(btn){ btn.setBadge('badgevalue')})

Haven't fully tested my own anser but I believe it is meant to be done through:

Ext.ComponentQuery.query();

This method should return the button components if let's say you do this:

var buttons = myseg.query('button); // return an array of components

and then loop through....

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