Ext.form.ComboBox

var storeCity = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({url:'city.jsp?type=city'}),
        reader: new Ext.data.ArrayReader({},[
            {name:'value'},
            {name:'text'}
        ])
    });
var comboCity = new Ext.form.ComboBox({
        store: storeCity,
        emptyText: '请选择',
        mode: 'remote',
        triggerAction: 'all',
        valueField: 'value',
        displayField: 'text',
        readOnly: true,
		applyTo: 'comboCity'
    });

 mode: 'remote' 当点击下拉框时会自动加载url返回的数据,不用手动添加load()方法

你可能感兴趣的:(combobox)