ExtJS 手风琴 setActiveItem
我正在使用 ExtJS 开发一个应用程序。 我有一个手风琴,需要选择一个活动项目(因此它会展开)。 Accordion.setActiveItem
输出以下内容:
"setActiveItem" 不是浏览器错误窗口中的函数。
第二个问题是设置时的 hideCollapseTool
属性在初始化中设置为 true,不执行任何操作。折叠工具仍在显示。
我正在使用 ExtJS 3.1.1。 我将非常感谢任何提示和答案。
I am developing an application using ExtJS.
I have an Accordion and need to select an active item(so it expands).Accordion.setActiveItem
outputs the following:
"setActiveItem" is not a function in a browser's error window.
Second issue is that hideCollapseTool
property, when set to true in the initialisation, doesn't do anything. Collapse tools still are being displayed.
I am using ExtJS 3.1.1.
I would be very thankful for any tips and answers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您还可以通过其组件 ID 来展开手风琴面板中的某些项目,如下所示:
You can also expand some item in an accordion panel by it's component id like this:
我将其修复在一个带有名为userview的引用的控制器中
I fixed it in a controller with a ref called userview
我花了整整 6 个小时来解决这个问题。 crash() 和 Expand() 似乎不起作用。我会在手风琴下方展开一个面板,其他面板会破裂。
最后发现,如果您的手风琴被隐藏,然后您在子面板上的崩溃()和展开()操作之前显示()它,则会发生一些问题。
我的解决方法是永远不要将手风琴设置为“hidden=true”并且永远不要 show() 它。相反,我使用 style={opacity:0} 开始,然后在需要查看时设置 opacity:100。这解决了所有问题,但不是最优雅的解决方案。
I spent a good 6 hours wrestling with this. collapse() and expand() didn't seem to be working. I'd expand a panel under the accordion and other panels would break.
Finally figured out there is some issue that happens if your accordion is hidden and then you show() it right before collapse() and expand() operations on the sub-panels.
My workaround was to never set the accordion to "hidden=true" and never show() it. Instead, I used style={opacity:0} to begin and then set opacity:100 when I needed to see it. This fixed everything, but isn't the most graceful solution.
我自己在
setActiveItem
方面运气不佳。在 Firebug 中检查它,手风琴面板甚至没有该方法。为了解决这个问题,我所做的就是对我想要聚焦的项目调用
expand()
,例如:
I have had little luck with
setActiveItem
myself. Examining it in Firebug, the accordion panel doesn't even have that method.What I did to get around it was to call
expand()
on the item I want to have focus,e.g. :