【发布时间】:2011-09-02 09:10:25
【问题描述】:
我有两个依赖组合框,第二个组合框的值是在第一个组合框的某个值被选中后填充的。
为此,我在第一个的选择事件中为第二个组合框使用 setValue。
以下是两种情况的代码,这里情况1不起作用,但情况2在IE9中起作用:
Case1: This doesn't work
select:function(combo, record){
Ext.getCmp('voyageMonitoritngVesselCode').store.load();//Loading the store of second combobox
Ext.getCmp('voyageMonitoritngVesselCode').setValue(record[0].data.vslCd);//Setting the value in the second combo-box
}
Case2: This works
select:function(combo, record){
Ext.getCmp('voyageMonitoritngVesselCode').store.load();//Loading the store of second combobox
alert(record[0].data.vslCd);//The only difference in both cases is this line
Ext.getCmp('voyageMonitoritngVesselCode').setValue(record[0].data.vslCd);//Setting the value in the second combo-box
}
也就是说,当我在加载存储和设置值之间编写警报语句时,值将显示在第二个组合框中,但如果我省略此警报,则组合框中没有设置值。
我觉得商店可能需要时间来加载,它可能是从警报消息停止中得到的。但作为解决方案,我在第二个组合中使用了 autoload:true,这样就不必加载商店,但情况仍然相同 - 没有警报就不会设置值。
有人能解释一下吗?
浏览器 - IE9
ExtJS - 4
提前致谢。
【问题讨论】:
标签: extjs combobox load internet-explorer-9 loading