ID91
27 Jun 2012, 4:49 AM
I have this store:
Ext.define("App.store.units.MyStore", {
extend:'Ext.data.Store',
requires: "App.model.units.MyModel",
model: "App.model.units.MyModel",
id:'myStore',
pageSize:10,
proxy: {
type: 'jsonp',
url: urls.MyUrl+"/search",
limitParam: 'undefined',
startParam: 'offSet',
pageParam: 'undefined',
extraParams: {
searchString: 'a'
},
reader: {
root: 'results.results',
totalProperty: 'numFound',
type: 'json'
}
}
});
The request works and I get the expected response.
For some reason, I got this in the browser(Firefox):
reader.read is not a function
But I have fixed it by adding a type:'json' in the reader config.
Here is also the (dynamic) definition of the model:
function(config){
try{
console.log("INIT MODEL");
Ext.define("App.model.units.MyModel", {
extend: 'Ext.data.Model',
fields: config
});
} catch(err){
console.log("Error");
}
}
This function is run before the store is created and the config object is an array of {name: 'value'} items.
I don't know what is wrong, because everything seems to run good in Firefox, but IE8 still has that error(even with the type:'json' in the reader). I think the reader isn't instatiated right in IE8, but I can't check it, since objects aren't displayed right in its console(or I don't have the knowledge to do so). Why doesn't the same javascript code run as it should?
EDIT It seems that the problems reoccurs on Firefox too. I do not know why, but the reader doesn't get instantiated as it should be.
Ext.define("App.store.units.MyStore", {
extend:'Ext.data.Store',
requires: "App.model.units.MyModel",
model: "App.model.units.MyModel",
id:'myStore',
pageSize:10,
proxy: {
type: 'jsonp',
url: urls.MyUrl+"/search",
limitParam: 'undefined',
startParam: 'offSet',
pageParam: 'undefined',
extraParams: {
searchString: 'a'
},
reader: {
root: 'results.results',
totalProperty: 'numFound',
type: 'json'
}
}
});
The request works and I get the expected response.
For some reason, I got this in the browser(Firefox):
reader.read is not a function
But I have fixed it by adding a type:'json' in the reader config.
Here is also the (dynamic) definition of the model:
function(config){
try{
console.log("INIT MODEL");
Ext.define("App.model.units.MyModel", {
extend: 'Ext.data.Model',
fields: config
});
} catch(err){
console.log("Error");
}
}
This function is run before the store is created and the config object is an array of {name: 'value'} items.
I don't know what is wrong, because everything seems to run good in Firefox, but IE8 still has that error(even with the type:'json' in the reader). I think the reader isn't instatiated right in IE8, but I can't check it, since objects aren't displayed right in its console(or I don't have the knowledge to do so). Why doesn't the same javascript code run as it should?
EDIT It seems that the problems reoccurs on Firefox too. I do not know why, but the reader doesn't get instantiated as it should be.