xtype : 'combobox',
id : 'combId',
fieldLabel : '职位',
store:....,
....
listeners : {
afterrender:function(){
if(this.store!=null){
Ext.getCmp('combId').setValue(this.store.getAt(0).get('job'));
}
if(Ext.getCmp('combId').getValue()!=null){ //当选中某一项时,触发的事件
},
select : function() {
//当选中某一项时,触发的事件
}
}
id : 'combId',
fieldLabel : '职位',
store:....,
....
listeners : {
afterrender:function(){
if(this.store!=null){
Ext.getCmp('combId').setValue(this.store.getAt(0).get('job'));
}
if(Ext.getCmp('combId').getValue()!=null){ //当选中某一项时,触发的事件
},
select : function() {
//当选中某一项时,触发的事件
}
}
本文介绍如何使用 ExtJS 库初始化一个组合框组件,并设置了默认选中的第一项,同时为组合框添加了当选中项变化时触发的事件监听。
490

被折叠的 条评论
为什么被折叠?



