-
22 May 2010 10:45 AM #1
ExtDesigner, ComboBox and JsonStore
ExtDesigner, ComboBox and JsonStore
I've created a simple form w/ ED that has two ComboBoxes pulling from a JsonStore (all defined w/ ED). I have it all running via my web server but when I activate the combo to populate, it makes the call to the server, gets the proper JSON response, but nothing winds up in the combo itself. I've tried flipping all kinds of settings around to no avail. I'm pretty certain it's just something stupid that I am overlooking, but I can't find it for the life of me.
Here's the relevant bits of code:
JsonStore:
ComboBox def in the formCode:TEX.store.Office = Ext.extend(Ext.data.JsonStore, { constructor: function(cfg) { cfg = cfg || {}; TEX.store.Office.superclass.constructor.call(this, Ext.apply({ storeId: 'locationStore', root: 'locations', url: '/location/list', totalProperty: 'total', idProperty: 'locationid' }, cfg)); } }); new TEX.store.Office();
Json Response when I activate the comboCode:{ xtype: 'combo', fieldLabel: 'Office', anchor: '100%', name: 'office', store: 'locationStore', triggerAction: 'all', valueField: 'locationid', displayField: 'name', id: 'office' }
Code:{"locations":[{"locationid":6,"name":"Atlanta"},{"locationid":13,"name":"Boston"},{"locationid":3,"name":"Calgary"},{"locationid":11,"name":"Dallas"},{"locationid":5,"name":"London"},{"locationid":14,"name":"Phoenix"},{"locationid":15,"name":"Raleigh"},{"locationid":2,"name":"South Florida"},{"locationid":1,"name":"Tampa"},{"locationid":4,"name":"Toronto"},{"locationid":12,"name":"Vancouver"}],"total":11}
-
25 May 2010 5:31 AM #2
As a quick follow-up, some debugging has turned up that part of my problem is in the readRecords() method in the JsonReader. Some extra, unused variables were tossing an exception. That bug is apparently fixed in svn but now I might be dying further down in the call to extractData().
-
25 May 2010 6:04 AM #3Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 6
I don't see any fields defined in your JsonStore. I'd expect to see this:
Code:TEX.store.Office = Ext.extend(Ext.data.JsonStore, { constructor: function(cfg) { cfg = cfg || {}; TEX.store.Office.superclass.constructor.call(this, Ext.apply({ storeId: 'locationStore', root: 'locations', url: '/location/list', totalProperty: 'total', idProperty: 'locationid', fields: [ { name: 'locationid' }, { name: 'name' } ] }, cfg)); } }); new TEX.store.Office();
-
26 May 2010 3:40 AM #4
Argh... Adding the fields config took care of it. Are there plans to add the ability to configure the fields for the store in the Designer? Maybe an auto-populate capability based on the fields returned?
-
26 May 2010 7:04 AM #5Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 6
Actually yes, you'll be happy to hear that there is :-)
Similar Threads
-
How was ExtDesigner developed?
By jarryh in forum Ext Designer: Help & DiscussionReplies: 2Last Post: 22 Apr 2010, 11:20 PM -
ComboBox missing attributes in ExtDesigner
By treadmill in forum Ext Designer: Help & DiscussionReplies: 1Last Post: 21 Apr 2010, 9:03 AM -
ExtDesigner bombs on my XP machine.
By BuckBazooka in forum Ext Designer: Help & DiscussionReplies: 4Last Post: 14 Apr 2010, 1:08 AM -
ExtDesigner via proxy, linux64
By BFT in forum Ext Designer: Help & DiscussionReplies: 2Last Post: 1 Apr 2010, 10:58 PM


Reply With Quote