PDA

View Full Version : Problem with first time using JSONStore.



tdondich
25 Nov 2007, 12:23 AM
Attempting to use JSONStore as my store, I have this as my store setup. (url masked to hide the ignorant). When attempting to perform a load on this store, a loadexception event is thrown with the message: Record has no properties. I can't tell if this refers to the Ext.data.Record object created in my fields, or if it refers to potentially a record in my json result. An sample JSON result is after code. Any help trying to figure out if I'm using JsonStore correctly, would be GREATLY appreciated. :)

Thanks in advance.

Taylor



var store = new Ext.data.JsonStore({
url: '****',
baseParams: {
request: 'CatalogQueueJobFetch',
catalogId: catalogId,
root: 'jobs',
fields:Ext.data.Record.create([{name: 'user'}, {name: 'description' }, {name: 'state'}, {name: 'created'}, {name: 'changed'}])
}
});


Example JSON Response:


{"jobs":[{"user":"Administrator","description":"testing","state":"awesome","changed":"11-24-07 11:43

:11PM","created":"11-24-07 11:43:11PM"},{"user":"Administrator","description":"just testing","state"

:"awesome","changed":"11-24-07 11:46:03PM","created":"11-24-07 11:46:03PM"},{"user":"Administrator","description"

:"testing","state":"awesome","changed":"11-24-07 11:49:44PM","created":"11-24-07 11:49:44PM"}]}

tdondich
25 Nov 2007, 12:24 AM
Nevermind. It's late. Silly object literals. Put my store onfig in my baseParams object by mistake.

alamandrax
25 Nov 2007, 12:39 AM
To err is human, to forgive divine.

I forgive you. :D