I m getting an error like I added below while using static data with memory proxy. Can someone show me my mistake or missing part?
提前感谢。
me.model is undefined
me.setProxy(me.proxy || me.model.getProxy());
我的示范定义:
Ext.define(appName + .model.Country , { extend: Ext.data.Model ,
fields: [
{type: string , name: abbr },
{type: string , name: name },
{type: string , name: slogan }
]
});
这是我的仓库定义:
// The data for all states
var data = {
states : [
{ abbr : AL , name : Alabama , slogan : The Heart of Dixie },
{ abbr : AK , name : Alaska , slogan : The Land of the Midnight Sun }
]
};
Ext.define(appName + .store.Countries , {
extend : Ext.data.Store ,
model : appName + .model.Country ,
data : data,
proxy: {
type: memory ,
reader: {
type: json ,
root: states
}
}
});