gpt4 book ai didi

EXTJS:过滤器存储不会发生第一次点击组合

转载 作者:行者123 更新时间:2023-12-05 00:06:10 24 4
gpt4 key购买 nike

我想过滤一个从组合中选择值的商店。当我选择第一个值时它不会过滤它但是在第二次选择任何其他值时它运行良好
我的商店有 autoLoad=true
这是我的代码

xtype: 'combo'
,fieldLabel: 'Online Type'
,name:'OnlineType'
,id:'cmbOnlineType'
,store: common.getStore(accounts20.dataForms.onlinePayments._storeOnlineType, accounts20.dataForms.onlinePayments)
,displayField:'OnlineType'
,valueField:'OnlineType'
,mode:'local' // important property when using store
,typeAhead: true
,triggerAction: 'all'
,selectOnFocus:true
,allowBlank:false
,forceSelection:true
,editable:true
,tabIndex:4
,width : 188
,listeners:{
select:function(){
if(Ext.getCmp('onlinePay-hdnMode').value!="E")
{
Ext.getCmp('onlinePay-cmbChequeNo').clearValue();
Ext.getCmp('onlinePay-cmbChequeNo').getStore().removeAll();
Ext.getCmp('onlinePay-cmbCrAccount').clearValue();
}
var store = Ext.getCmp('onlinePay-cmbCrAccount').getStore();
if(this.getValue()=="Cheque" || this.getValue()=="Internet/Mobile")
{
Ext.getCmp('onlinePay-chkIncCharges').setValue(false);
if(this.getValue()=="Internet/Mobile")
{
Ext.getCmp('onlinePay-cmbChequeNo').disable();
Ext.getCmp('onlinePay-chkIncCharges').disable();
}else{
Ext.getCmp('onlinePay-cmbChequeNo').enable();
Ext.getCmp('onlinePay-chkIncCharges').enable();
}
//Filter store on bank accounts
store.filter([
{
property : 'AccountTypeId',
value : 'B',//Bank Accounts
anyMatch : true, //optional, defaults to true
caseSensitive: false //optional, defaults to true
} ,
//filter functions can also be passed
{
fn : function(record) {
return record.get('AccountTypeId') == 'B';
},
scope: this
}
]);
}else if(this.getValue()=="Cash"){
Ext.getCmp('onlinePay-chkIncCharges').setValue(true);
Ext.getCmp('onlinePay-chkIncCharges').disable();
Ext.getCmp('onlinePay-cmbChequeNo').disable();
//Filter store on cash accounts
store.filter([
{
property : 'AccountTypeId',
value : 'C',//Cash Accounts
anyMatch : true, //optional, defaults to true
caseSensitive: false //optional, defaults to true
} ,
//filter functions can also be passed
{
fn : function(record) {
return record.get('AccountTypeId') == 'C';
},
scope: this
}
]);
}
}//end of select function
}//end of listener

最佳答案

关于EXTJS:过滤器存储不会发生第一次点击组合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3582935/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com