Ext 구현 드롭다운 질의 Combox(Local)

1671 단어 ext
/**
 *  
 * 
 * @type
 */
var makes = [['Acura'], ['Aston Martin'], ['Audi'], ['BMW'], ['Buick'],
		['Cadillac'], ['Chevrolet'], ['Chrysler'], ['Dodge'], ['Ferrari'],
		['Ford'], ['GMC'], ['Honda'], ['HUMMER'], ['Hyundai'], ['Infiniti'],
		['Isuzu'], ['Jaguar']]
/**
 *  store
 */
var makesStore = new Ext.data.SimpleStore({
			fields : ['name'],
			data : makes
		});
/**
 *  combox
 * 
 */
var makesCombo = {
	xtype : 'combo',
	store : makesStore,
	displayField : 'name',
	valueField : 'name',
	editable : true,
	mode : 'local',
	forceSelection : true,
	triggerAction : 'all',
	filedLabel : ' ',
	emptyText : ' ',
	selectOnFocus : true
};
/**
 *  combox
 */
Ext.onReady(function() {
			var showcombo = new Ext.Panel({
						frame : true,
						title : ' ',
						bodyStyle : 'padding:5px',
						width : 420,
						id : 'comb',
						url : '...',// 
						items : [makesCombo],
						buttons : [{
									text : ' ',
									handler : function() {
										Ext.getCmp('comb').getForm().submit;
									}
								}]
					});
			//  body 
			showcombo.render(document.body);
		})

효과도는 첨부를 보십시오.

좋은 웹페이지 즐겨찾기