PDA

View Full Version : Combobox.load() - shows that still loading data



ytppa
18 Dec 2011, 8:29 PM
Trying to make a dynamic update of combobox store, here is a part of my code:


Ext.define('MyComboModel', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'string'},
{name: 'name', type: 'string'}
]
});

var myStore2 = Ext.create('Ext.data.Store', {
model: 'MyComboModel',
proxy: {
type: 'ajax',
url : '/ajax/internat_get_list.php',
reader: {
type: 'json',
root: 'users'
}
},
autoLoad: true
});

var myCombo = new Ext.form.ComboBox({
xtype: 'combo',
allowBlank: false,
editable: false,
triggerAction: 'all',
typeAhead: false,
width:180,
store: myStore2,
displayField: 'name',
valueField: 'id',
fieldLabel: '????????',
queryMode: 'local',
name: 'st'
});

myupdate = function(id, value) {
myStore2.load();
//myCombo.store = myStore2;
//myCombo.bindStore(myStore2);
//myCombo.clearValue();
//myCombo.doLayout();
}

30126
on page startup - combobox works correct (look at frame #1, frame #2 on uploaded image).
As you can see, for the testing, my php script returns a list with timestamp in one of values in array. here is /ajax/internat_get_list.php:


echo '[
{ "id": 1, "name": "Ed Spencer5"},
{ "id": 2, "name": "Abe Elias5"},
{ "id": 3, "name": "' . time() . '"},
{ "id": 4, "name": "Abe Elias7"}
]';

but when i call "myUpdate" function - some data in my combobox changes, we can see it on frame #3 (timestamp changed), but when i opens a list of items of combobox (frame #4) - it tells me that combobox data is loading.. =(
Whats wrong?

skirtle
18 Dec 2011, 9:31 PM
I suspect you may be running into a known bug in 4.0.7. There are a couple of fixes discussed here:

http://www.sencha.com/forum/showthread.php?156908