我将JSON文件加载到商店但我有0.8秒的加载时间。 为什么呢?
这是商店创建和向我显示加载时间的提醒:
var start = new Date();
var store = Ext.create('ExtDoc.stores.extwindow.ExtDocGridStore');
store.initStore("file.json");
store.load({
callback: function(records, operation, success){
if(success == true){
var end = new Date();
var duration = end - start;
alert(duration/1000);
}
}
});
ExtDoc.stores.extwindow.ExtDocGridStore文件:
Ext.define('ExtDoc.stores.extwindow.ExtDocGridStore', {
requires:[ 'ExtDoc.models.extwindow.ExtDocGridModel'],
extend: 'Ext.data.Store',
model: 'ExtDoc.models.extwindow.ExtDocGridModel',
proxy: {
type: 'ajax',
pageParam: false,
startParam: false,
limitParam: false,
noCache: false,
method: 'GET',
reader: {
async: false,
type: 'json',
rootProperty: ''
}
},
initStore: function(dataUrl){
this.getProxy().setUrl(dataUrl);
}
});
file.json:
empty file