xtype : "combobox",
fieldLabel : "选择省份",
name : "provincename",
id :"provincename",
labelAlign : "left",
emptyText:"请选择省份",
typeAhead:true,
queryMode:"local",
allowBlank : false,
forceSelection : true,
store:Ext.create("Ext.data.ArrayStore",
{
fields:["key","value"],
data:[["bj","北京"],["tj","天津"],["sh","上海"],["cq","重庆"],["hb","河北"],["hen","河南"],["yn","云南"],["ln","辽宁"],["hlj","黑龙江"],["hun","湖南"],["ah","安徽"],["sd","山东"],["xj","新疆"],["js","江苏"],["zj","浙江"],["jx","江西"],["hub","湖北"],["gx","广西"],["gs","甘肃"],["sx","山西"],["nmg","内蒙"],["shanx","陕西"],["jl","吉林"],["fj","福建"],["gz","贵州"],["gd","广东"],["qh","青海"],["xz","西藏"],["sc","四川"],["nx","宁夏"],["hn","海南"],["tw","台湾"],]
}),
valueField:"key",
displayField:"value",
listeners:{
'change':function(t,n,o,e){
alert(temp==null);
temp = n;
//Ext.getCmp("cityname").setDisabled(false);
//alert(n);
//alert(r.pop().get("key"));
// if(temp==null){temp=n;}else{temp=n;}
Ext.getCmp("cityname").reset();
store1.load({
callback: function(records, options, success){
Ext.Msg.alert('info', '加载完毕');
},
scope: store, //Scope用来指定回调函数执行时的作用域
//Add为true时,load()得到的数据会添加在原来的store数据的末尾,
//否则会先清除之前的数据,再将得到的数据添加到store中
add: false
});
}
// ,
// 'change':function(t,n,o,e){
// alert('change');
// }
}
},
{
xtype:"combobox",
fieldLabel:"选择城市",
name:"cityname",
id:"cityname",
queryMode:"local",
//disabled:true,
triggerAction:"all",
store:store1,
multiSelect:true,
labelAlign:"left",
emptyText:"请选择城市",
typeAhead:true,
valueField:"key",
displayField:"key",
forceSelection:true,
defaultListConfig:{
loadMask: false
}
}
store1 = Ext.create("Ext.data.Store",{
fields:[{name:"key"}],
//remoteSort:true,
autoLoad:true,
proxy : new Ext.data.HttpProxy({
url:"getAllCityName.action",
actionMethods:{
read:"get"
},
reader : {
type:"json",
root : "Rows"
}
})
});
store1.on("beforeload",function(c,d){
alert("before");
var b = {
"name" : temp
};
Ext.apply(c.proxy.extraParams, b)
});
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/bian-cheng-ji-chu/80352.html