Ext 下拉列表 主动加载

        customerDs = new Ext.data.JsonStore({
		url : 'queryCustomerType.action?',
		fields : [ 'value', 'text' ]
	});
	customerCom = new Ext.form.ComboBox({
		hiddenName : "pageId",
		fieldLabel : 'pageId',
		typeAhead : true,
		triggerAction : 'all',
		lazyRender : false,
		mode : 'local',
		store : customerDs,
		valueField : 'value',
		displayField : 'text' 
	});
	customerDs.load({
		callback : function(r, options) {
			customerCom.setValue("2");
		}
	}); 
json:
[{"value":1,"text":"A"},
{"value":2,"text":"B"},
{"value":3,"text":"C"},
{"value":4,"text":"D"},
{"value":5,"text":"VIPA"},
{"value":6,"text":"VIPB"},
{"value":7,"text":"VIPC"},
{"value":8,"text":"VIPD"}]
 
 

   

你可能感兴趣的:(Ext 下拉列表 主动加载)