I have a problem creating a store and I need some help. I have a store, created using Ex.define approach and it works just fine. Here is the code:
Ext.define('path.to.myStore', {
extend: 'Ext.data.Store',
model: 'arm4.dict.m.DictBaseModel',
proxy: {
type: 'ajax',
url: 'data/module-dict/PossessionGroundWs/find',
reader: {
type: 'json',
root: 'dataList'
}
}
});
//later
//works fine!
var s =Ext.create('path.to.myStore');
s.load();
Now, the problem is I want to create store dynamically, without Ex.define. This is how I do it:
var s = Ext.create('Ext.data.Store', {
model: 'arm4.dict.m.DictBaseModel',
proxy: {
type: 'ajax',
url: 'data/module-dict/PossessionGroundWs/find',
reader: {
type: 'json',
root: 'dataList'
}
}
});
s.load();
As you can see, it uses exactly the same configuration, but this doesn't work. I get this error:
TypeError: reader.read is not a function
result = reader.read(me.extractResponseData(response));
When I dig into Extjs code, I can see that reader is not initialized by some reason.
"reader" looks like this:
{
applyDefaults:true
root:"dataList"
type:"json"
}
So, what am I doing wrong? Can you reproduce this error(bug)?