twh
30 Aug 2010, 3:32 PM
I've simplified the JsonStore example in the documentation here:
http://dev.sencha.com/deploy/ext/docs/output/Ext.data.JsonStore.html
Ext.setup({
onReady: function() {
var store = new Ext.data.JsonStore({
// store configs
autoDestroy: true,
url: 'get-images.php',
storeId: 'myStore',
// reader configs
root: 'images',
idProperty: 'name',
fields: ['name', 'url', 'size', 'lastmod']
});
}
});
The only thing I changed was wrapping the creation of the store var in an Ext.setup() call and created a get-images.php file which returns a JSON object with name, url, size, and lastmod values. And yet when I load the page, I get this error:
TypeError: Result of expression 'this.model' [undefined] is not an object.
Is there something I'm missing, or is the example incomplete? It isn't clear what other code is necessary to create a store.
http://dev.sencha.com/deploy/ext/docs/output/Ext.data.JsonStore.html
Ext.setup({
onReady: function() {
var store = new Ext.data.JsonStore({
// store configs
autoDestroy: true,
url: 'get-images.php',
storeId: 'myStore',
// reader configs
root: 'images',
idProperty: 'name',
fields: ['name', 'url', 'size', 'lastmod']
});
}
});
The only thing I changed was wrapping the creation of the store var in an Ext.setup() call and created a get-images.php file which returns a JSON object with name, url, size, and lastmod values. And yet when I load the page, I get this error:
TypeError: Result of expression 'this.model' [undefined] is not an object.
Is there something I'm missing, or is the example incomplete? It isn't clear what other code is necessary to create a store.