PDA

View Full Version : ComboBox Won't Load JSON Store Values



darren
6 Apr 2010, 9:44 AM
Hi guys, I can't seem to find what I am doing wrong here. I thought I had mapped it correctly. Here is my store:



var store = new Ext.data.JsonStore({
autoDestroy: true,
autoLoad: true,
url: '/system/json/ips',
fields: [ 'ip' ],
root: 'ips'
});


and here is my ComboBox:


xtype: 'combo',
name: 'ip',
fieldLabel: 'IP',
store: store,
displayField: 'ip',
allowBlank: false


But it won't display anything and its loading the data fine. The data is formated as follows:

{"total":2,"ips":[{"ip":"255.0.0.0"},{"ip":"255.255.0.0"}]}

Does anyone know what I am missing?

darren
6 Apr 2010, 10:34 AM
I have also tried this:
xtype: 'combo',
name: 'ip',
fieldLabel: 'IP',
store: new Ext.data.JsonStore({
url: '/system/json/ips',
root: 'ips',
fields: [ 'ip' ],
}),
triggerAction: 'all',
displayField: 'ip',
valueField: 'ip',
allowBlank: false

And it will no populate. Does anyone know what is wrong?

darren
6 Apr 2010, 10:45 AM
Sorry guys had to add mode: 'remote'.