Hi I'm having trouble making a comboBox, I'd really appreciate if you help me, here's the code for my store:
Ext.define('Benef', {
extend: 'Ext.data.Model',
fields: ['id', 'name']
});
var bene = new Ext.data.Store({
model: 'Benef',
reader: new Ext.data.JsonReader({
fields: ['id', 'name'],
root: 'benef'
}),
proxy: new Ext.data.HttpProxy({
url: '../data/benef.php'
})
});
When benef.php is called, it sends names of people this way:
{
"benef":[
{"id":"1","name":"Person"},
{"id":"2","name":"aPerson"},
{"id":"3","name":"Per 2"},
{"id":"4","name":"BeneP"},
{"id":"5","name":"BeneA"}
]
}
And my comboBox code is:
dataIndex: 'benefOne',
width: 150,
header: 'Benef',
editor: {
xtype: 'combobox',
typeAhead: true,
selectOnTab: true,
allowBlank: false,
autoSelect: true,
editable: false,
store: bene,
mode: 'local',
triggerAction: 'all',
displayField: 'name',
valueField: 'name',
lazyRender: true,
listClass: 'x-combo-list-small'
}
Everything seems to work fine when I run the script, firebug gets the answer from benef.php but when I click the combobox to display the values, it only shows a tiny blank field :s any ideas? Thanks in advance!