admin管理员组文章数量:1390204
I'm using ExtJS 5.1. I have a panel with a definition of button in the items-section with a listerner for event 'click'. The 'this'-keyword refers here to the button itself. But I want a new ponent to my panel, so I need reference to this panel in the listener-function. 'this.getParent().add(...)' doesn't function, no function error, this.container.getParent().add(...) results in the same error. What is the correct way?
I'm using ExtJS 5.1. I have a panel with a definition of button in the items-section with a listerner for event 'click'. The 'this'-keyword refers here to the button itself. But I want a new ponent to my panel, so I need reference to this panel in the listener-function. 'this.getParent().add(...)' doesn't function, no function error, this.container.getParent().add(...) results in the same error. What is the correct way?
Share Improve this question asked Apr 26, 2016 at 11:27 Rafal ZiolkowskiRafal Ziolkowski 131 gold badge2 silver badges7 bronze badges 1- You need to post the code. – Evan Trimboli Commented Apr 26, 2016 at 12:05
1 Answer
Reset to default 3Using .up('panel')
in the first argument of the click function, which is the button itself.
Or in ExtJS 5 define a reference
property in your panel, and use
this.lookupReference('your_reference_in_panel');
本文标签: javascriptGet parent component in ExtJSStack Overflow
版权声明:本文标题:javascript - Get parent component in ExtJS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744647196a2617468.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论