combo 添加listeners,使用 initComponent、constructor 的区别
来源:互联网 发布:网络好听的歌曲排行榜 编辑:程序博客网 时间:2024/06/06 19:36
LocationCombo = Ext.extend(Ext.form.ComboBox,{
initComponent: function(){
var config = {
name: 'loactionCombo'
,hiddenName: 'loactionCombo'
,fieldLabel: '所在区域'
,store: [['-1','请选择...']]
,triggerAction: 'all'
,mode: 'local'
,autoScroll: true
,expandPanel : new LocationTree()
,listeners: {
'expand': function(){
alert('expand...');
// if(!combo.expanded){
// combo.expandPanel.render(combo.el);
// combo.doLayout();
// combo.expanded = true;
// //applyToMarkup
// }
}
,'collapse': function(){
alert('collapse');
//document.getElementById('tree').innerHTML='';
}
}
}
this.addListener('expand',function(){alert('2expand..')});
Ext.apply(this, config);
LocationCombo.superclass.initComponent.call(this);
}
initComponent: function(){
var config = {
name: 'loactionCombo'
,hiddenName: 'loactionCombo'
,fieldLabel: '所在区域'
,store: [['-1','请选择...']]
,triggerAction: 'all'
,mode: 'local'
,autoScroll: true
,expandPanel : new LocationTree()
,listeners: {
'expand': function(){
alert('expand...');
// if(!combo.expanded){
// combo.expandPanel.render(combo.el);
// combo.doLayout();
// combo.expanded = true;
// //applyToMarkup
// }
}
,'collapse': function(){
alert('collapse');
//document.getElementById('tree').innerHTML='';
}
}
}
this.addListener('expand',function(){alert('2expand..')});
Ext.apply(this, config);
LocationCombo.superclass.initComponent.call(this);
}
});
使用initComponent时,在config对象中写listeners无效,需使用方法添加。而使用constructor则支持 在config对象中写listeners,但ext.2.0不支持constructor.
- combo 添加listeners,使用 initComponent、constructor 的区别
- ExtJS4中initComponent和constructor的区别
- ExtJS4中initComponent和constructor的区别
- [Ext JS 4] Extjs 之 initComponent 和 constructor的区别
- [Ext JS 4] Extjs 之 initComponent 和 constructor的区别
- [Ext JS 4] Extjs 之 initComponent 和 constructor的区别
- Extjs4 initComponent 和 constructor 的一点题目
- constructor与initComponent
- constructor与initComponent
- initComponent还是constructor
- AjaxEvent、AjaxMethod和Listeners的区别
- Combo Box 的使用
- Combo box的使用
- Ext组件化编程是用initcomponent还是constructor
- Coolite AjaxEvents、Listeners区别
- combo box控件的使用
- COMBO BOX的使用格式!~
- SWT之Combo的使用
- 第二部分 MediaPlayer的接口与架
- 恢复Ubuntu 11.04的通知区域
- 编译EDK
- ASIHTTPReques用法
- 是什么浪费了我的上网时间?
- combo 添加listeners,使用 initComponent、constructor 的区别
- 第三部分 MediaPlayer的主要实现分析
- JQuery ajax跨域访问
- mysql 主从复制读写分离实现
- FORM中使用onSubmit="return false"防止表单自动提交,以及submit和button提交表单的区别
- 2-SAT——6.0(poj2749 Building roads)
- JAVA 中常用的几个集合类
- OPhone学习笔记 2
- Android开发之旅:应用程序基础及组件(续)