In my project I have a memory store with local data for a combobox.
I insert the data via store.loadData()
but also tried store.loadRawData()
.
The data is in the store, but when I assign it to a combobox, no selection of items is possible. The combobox is empty.
For example I have the following data
var data = [
{
name: 'Tom',
age: 20
},
{
name: 'Peter',
age: 30
}
];
I configer the store with a memory proxy and fields.
var store = Ext.create('Ext.data.Store', {
fields: [
'name',
'age'
],
proxy: {
type: 'memory',
reader: {
type: 'json'
}
}
});
Somwhere in my application I load the data into it with
store.loadRawData(data, false);
Then I assign the store to a combobox, but no selection is possible.
var combobox = Ext.create('Ext.form.field.ComboBox', {
queryMode: 'local',
typeAhead: true,
forceSelection: true,
valueField: 'name',
store: store
});
But when I iterate over the data of the store and log it to console, every data row is in there.
store.each(function(record){
console.log('name in store: %s', record.get('name'));
});
// In console:
// name in store: Tom
// name in store: Peter
I use ExtJs 5.0.1 and a fiddle can be found at Sencha Fiddle.
What am I missing here?
Thank you for every suggestion and hint.