-
30 Aug 2010 3:32 PM #1
[FIXED-254] JsonStore example broken in documentation
[FIXED-254] JsonStore example broken in documentation
I've simplified the JsonStore example in the documentation here:
http://dev.sencha.com/deploy/ext/doc...JsonStore.html
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:Code: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'] }); } });
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.
-
30 Aug 2010 11:30 PM #2
The code is incorrect in the class, but in a lot of way it's not needed anymore. One of the main reasons it existed is because in Ext there wasn't really a simple way to construct a store with just json, but now you can do:
Which isn't really much longer than what we already have.Code:new Ext.data.Store({ fields: ['name', 'url', 'size', 'lastmod'], reader: { root: 'images' idProperty: 'name' }, proxy: { url: 'get-images.php' } });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
8 Sep 2010 10:55 PM #3
The docs have been updated in 0.94 to reflect the correct usage.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[FIXED][2.2.x] allowContainerDrop is still broken
By Deadmeat in forum Ext 2.x: BugsReplies: 3Last Post: 4 May 2009, 2:47 PM -
Links to .js source files in the API Documentation are Broken
By Gjslick in forum Community DiscussionReplies: 3Last Post: 3 May 2009, 9:46 AM -
[FIXED][3.0] grouptabs example broken
By amorworx in forum Ext 3.x: BugsReplies: 6Last Post: 24 Apr 2009, 1:27 AM -
[FIXED][3.0] grouptabs example broken
By amorworx in forum Ext 2.x: BugsReplies: 5Last Post: 9 Apr 2009, 2:13 PM -
JsonStore + typeahead = broken?
By alos in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 15 Dec 2007, 5:05 PM


Reply With Quote