ExtJS4combobox 设置默认选中值

var combostore = new Ext.data.ArrayStore({
	        fields: ['val', 'lbl'],
	        data: [['0', '已注册'], ['1', '已审核通过'], ['2', '已审核未通过'], ['3', '已无效']]
	    });
===================================================
{
					xtype:'label',
					text:'状态:'
				},{
					xtype:'combo',
					id:'state',
					width:130,
					store:combostore,
					displayField: 'lbl',
					valueField: 'val',
					editable: true,
					mode: 'local',
					triggerAction: 'all'

				},
=============================================
listeners:{
 			    //双击事件
				itemdblclick:function(view,record,item,index,e,eOpts){
		    		//alert(record.get('id'));//双击获取id 
					//alert(index);
		    	},
 		        //渲染之后
 		        afterrender : function(){ 
		    	    Ext.getCmp('state').reset();
                 Ext.getCmp('state').setValue(combostore.getAt(1)); 
                }
			}

你可能感兴趣的:(combobox)