//服务器取数据
var remoteStore = Ext.create('Ext.data.Store', {
proxy: ({
type: "ajax",
url:"---------路径--------",
extraParams: ******,
method: "POST",
reader: {
type: 'json',
rootProperty: "data",
fields: ["partnerId", "partnerFullName"]
}
}),
listeners:{
load:function(store ,records ,successful ,eOpts ){
console.log(successful);
console.log(eOpts);
}
},
fields: ["partnerId", "partnerFullName"]
});
//创建搜索下拉框
var stockCombo = new Ext.form.ComboBox({
fieldLabel: '转入账户',
margin: '15 0 0 30',
labelWidth: 60,
hiddenName: 'partnerId',
hideTrigger: true,
displayField: 'partnerFullName',
valueField: 'partnerId',
forceSelection: true,
queryDelay: 300,
enableKeyEvents: true, //监听输入
store: remoteStore,
queryMode:'remote',
queryParam: 'partnerName', //查询时往后台的参数
minChars: 2 //输入两个字符时自动查询
});