为什么我无法在 Ext.override中获取变量
Why I can't get the variable in Ext.override?
(function(){
var foo = "me";
Ext.override(Ext.PagingToolbar, {
initComponent : function(){
console.debug(foo);
}
});
})();
但我无法在 initComponent 方法中获取 foo 的值,如何?
1、我可以在 initComponent 方法中获取 foo 的值,但你不调用它,代码写就可以了
(function(){
var foo = "me";
alert(foo);
Ext.override(Ext.PagingToolbar, {
initComponent : function(){
console.debug(foo);
}
});
var panel = new Ext.PagingToolbar();
panel.initComponent();
})();
相关文章:
- 使用 jQuery 的 .on 函数如何获取事件的原始元素
- jquery试图按名称获取按钮位置
- 如何在jQuery中获取元素的形式
- 如何在php文件中获取$.post-ajax传递的值
- 在Shopify中获取博客文章的图片
- 使用Javascript获取所选选项ID
- 在jQuery中获取表的行索引
- 使用jquery将mysql数据获取到新的表行中
- 在动态创建的元素上获取对特定选择器的引用
- 从城市名称获取惊喜
- Angular只从数组中获取所需的数据
- 无法将数据从firebase获取到我的html页面
- 从ajax请求中获取javascript对象
- 如何从画布上的某个移动事件中获取X和Y
- 是否有一个JS/jQuery函数可以获取某个类的每个元素的ID
- 如何在PHP中使用$_POST获取Select元素值
- 获取@ResponseBody的一部分作为主干和Spring MVC控制器之间的参数
- 从Rally获取一个特定的标记,以便计算另一个字段中的值
- Twitter Bootstrap typeahead:使用“this”获取上下文/调用元素
- 为什么我无法在 Ext.override中获取变量