SubComboList = Ext.extend(Ext.data.JsonStore, {
constructor: function (cfg) {
cfg = cfg || {};
SubComboList.superclass.constructor.call(this, Ext.apply({
storeId: 'SubComboList',
root: 'datastr',
autoLoad:true,
totalProperty: 'totalcount',
url: '../datastore/JsonDataPage/Subject/SubImport.aspx?param=select&rnd=' + Math.random(),
fields: [
{
name: 'Id'
},
{
name: 'SubjectBH'
},
{
name: 'SubjectName'
}
]
}, cfg));
}
});
当Store 单独写在一个文件中时,使用new 方法如果Url正确,会造成自动在后台加载数据的结果。如果对多个Store同时使用new 方法且后台访问的页面相同,会造成异部冲突。
解决办法:将autoLoad设置为false,然后使用load()方法手动加载
本文探讨了ExtJS框架中Store组件配置自动加载(autoLoad)属性为true时可能遇到的问题,特别是在多个Store实例指向同一后台接口的情况下。文章提供了解决方案,即通过手动调用load方法来避免异步加载冲突。
842

被折叠的 条评论
为什么被折叠?



