extjs自定义下拉框可以是表格或者树形

new Ext.form.ComboBox({
		    	    typeAhead: true,
		    	    triggerAction: 'all',
		    	    lazyRender:true,
		    	    mode: 'local',
		    	    listeners: {"expand":function(v){
		    	      v.getStore().removeAll();
			    	  var SexRecord=Ext.data.Record.create([{name: 'displayText', type: 'string'},{name: 'myId', type: 'int'}]);  
			    	  v.getStore().add(new SexRecord({myId:3,displayText:'item3'}));
		    	     }
		         },
		    	    store: new Ext.data.ArrayStore({
		    	        id: 0,
		    	        fields: [
		    	            'myId',
		    	            'displayText'
		    	        ],
		    	        data: [[1, 'item1'], [2, 'item2']]
		    	    }),
		    	    valueField: 'myId',
		    	    displayField: 'displayText'
		    	}),

 

你可能感兴趣的:(extjs自定义下拉框)