extjs combobox展开后会去后台执行2次获取数据
代码如下://数据源varattackSubComboStore=newExt.data.JsonStore({url:__ctxPath+'/strategy/quer...
代码如下:
//数据源
var attackSubComboStore=new Ext.data.JsonStore({
url: __ctxPath+'/strategy/queryStrategyTypeList.do?type=attackSub',
root: 'result',
fields: ['DICT_ID','NAME']
});
//加载
attackSubComboStore.load();
下面有个下拉框
{
fieldLabel:'实现类型',
xtype:'combo',
typeAhead: true,
editable : false,
triggerAction: 'all',
displayField : 'NAME', valueField : 'DICT_ID',
id:'attackSubType',
name:'attackSubType',
hiddenName:'attackSubType',
store:attackSubComboStore,
allowBlank:false,
//(第一次)执行下拉框展开事件后,会去后台执行2次,获取数据源,这是为什么呢???
// (第二次)执行又只去后台执行1次
listeners:{
'expand':function(combo){
attackSubComboStore.load({
params:{pid:attackSupType}
});
}
}
} 展开
//数据源
var attackSubComboStore=new Ext.data.JsonStore({
url: __ctxPath+'/strategy/queryStrategyTypeList.do?type=attackSub',
root: 'result',
fields: ['DICT_ID','NAME']
});
//加载
attackSubComboStore.load();
下面有个下拉框
{
fieldLabel:'实现类型',
xtype:'combo',
typeAhead: true,
editable : false,
triggerAction: 'all',
displayField : 'NAME', valueField : 'DICT_ID',
id:'attackSubType',
name:'attackSubType',
hiddenName:'attackSubType',
store:attackSubComboStore,
allowBlank:false,
//(第一次)执行下拉框展开事件后,会去后台执行2次,获取数据源,这是为什么呢???
// (第二次)执行又只去后台执行1次
listeners:{
'expand':function(combo){
attackSubComboStore.load({
params:{pid:attackSupType}
});
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询