extjs combox

var crdtypeStore_CX = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : ''
}),
reader : new Ext.data.JsonReader({}, [{
name : 'value'
}, {
name : 'text'
}]),
autoLoad:true
});
var crdtypeCombo_CX = new Ext.form.ComboBox({
name : 'crd_type',
hiddenName : 'crdtype',
fieldLabel : '卡种类',
emptyText : '请选择卡种类...',
triggerAction : 'all',
store : crdtypeStore_CX,
displayField : 'text',
valueField : 'value',
loadingText : '正在加载数据...',
mode : 'remote', // 数据会自动读取,如果设置为local又调用了store.load()则会读取2次;也可以将其设置为local,然后通过store.load()方法来读取
forceSelection : true,
typeAhead : true,
resizable : true,
editable : false,
allowBlank : false, // 是否允许为空
//labelStyle : 'color:red;',
anchor : '95%',
renderer : CARDTYPERender
});
crdtypeCombo_CX.on('select', function() {
crdkindCombo_CX.clearValue();
var value = crdtypeCombo_CX.getValue();
crdkindStore_CX.load({
params : {
crd_type : value
}
});
});
/** ***************定义查询"卡类别"下拉框******************** */
var crdkindStore_CX = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : ''
}),
reader : new Ext.data.JsonReader({}, [{
name : 'value'
}, {
name : 'text'
}]),
autoLoad:true

});

var crdkindCombo_CX = new Ext.form.ComboBox({
name : 'crd_kind',
hiddenName : 'crdkind',
fieldLabel : '卡类别',
emptyText : '请选择卡类别...',
triggerAction : 'all',
store : crdkindStore_CX,
displayField : 'text',
valueField : 'value',
loadingText : '正在加载数据...',
mode : 'local', // 数据会自动读取,如果设置为local又调用了store.load()则会读取2次;也可以将其设置为local,然后通过store.load()方法来读取
forceSelection : true,
typeAhead : true,
resizable : false,
editable : false,
allowBlank : false, // 是否允许为空
//labelStyle : 'color:red;',
anchor : '95%'
});

crdkindCombo_CX.on('select', function() {
var value = crdkindCombo_CX.getValue();
});



修改窗体打开时调用:crdtypeStore_CX.on("load", function(crdtypeStore_CX, records, option) {
for(i = 0; i < records.length; i++) {
if(records[i].data.checked == true) {
crdtypeCombo_CX.setValue(records[i].data.value);
} }
});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值