this.getUrl = 'test';
this.items.add(
new Ext.form.Checkbox(
{
listeners: {
check: function(checkbox, checked) {
alert(this.getUrl);
},
}
)
)
我如何访问
this.getUrl
在检查处理程序中?
最佳答案
我想知道为什么没有人提出明显的建议,只需使用 Ext 方式并使用 'scope' 配置属性:
this.getUrl = 'test';
this.items.add(
new Ext.form.Checkbox(
{
listeners: {
check: function(checkbox, checked) {
alert(this.getUrl);
},
scope: this
}
)
)
关于extjs - 如何在 ExtJS 事件处理程序中访问类变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5967348/