mntek
30 Nov 2011, 7:56 AM
Hello!I'm use two comboboxes, select value in first fire ajax store update in second. Update works good, but on second and more updates in second combobox appear loading panel, which not closed, like this:29704
extjs 4.0.7, code:
var languageStore = new Ext.data.Store({
autoLoad: true,
storeId: 'languagesStore',
proxy: {
type: 'ajax',
url: 'languages.json.php',
reader: {
type: 'json',
root: 'languages'
}
},
fields: [{name: 'id', type: 'int'}, {name: 'name', type: 'string'}]
});
var languageCombobox = new Ext.form.ComboBox({
fieldLabel: 'Язык',
id: 'language-combo',
store: languageStore,
disabled: false,
valueField: 'id',
displayField: 'name',
emptyText: 'Выберите страну…',
editable: false,
listeners:
{
select:
{
fn: function(combo, value)
{
var cc = Ext.getCmp('country-combo');
cc.clearValue();
if (cc.isDisabled())
cc.setDisabled(false);
cc.getStore().load({params: {languageId: combo.getValue()}});
}
}
}
});
var countryStore = new Ext.data.Store({
storeId: 'countriesStore',
proxy: {
type: 'ajax',
url: 'countries.json.php',
reader: {
type: 'json',
root: 'countries'
}
},
fields: [{name: 'id', type: 'int'}, {name: 'name', type: 'string'}]
});
var countryCombobox = new Ext.form.ComboBox({
fieldLabel: 'Страна',
id: 'country-combo',
store: countryStore,
disabled: true,
valueField: 'id',
displayField: 'name',
emptyText: 'Выберите страну…',
queryMode: 'local',
editable: false
});
Json answer look like this:
{"countries":[{"id":"1","name":"Great Britain"},{"id":"2","name":"USA"}],"total":2}
Can I hide this loading panel?
extjs 4.0.7, code:
var languageStore = new Ext.data.Store({
autoLoad: true,
storeId: 'languagesStore',
proxy: {
type: 'ajax',
url: 'languages.json.php',
reader: {
type: 'json',
root: 'languages'
}
},
fields: [{name: 'id', type: 'int'}, {name: 'name', type: 'string'}]
});
var languageCombobox = new Ext.form.ComboBox({
fieldLabel: 'Язык',
id: 'language-combo',
store: languageStore,
disabled: false,
valueField: 'id',
displayField: 'name',
emptyText: 'Выберите страну…',
editable: false,
listeners:
{
select:
{
fn: function(combo, value)
{
var cc = Ext.getCmp('country-combo');
cc.clearValue();
if (cc.isDisabled())
cc.setDisabled(false);
cc.getStore().load({params: {languageId: combo.getValue()}});
}
}
}
});
var countryStore = new Ext.data.Store({
storeId: 'countriesStore',
proxy: {
type: 'ajax',
url: 'countries.json.php',
reader: {
type: 'json',
root: 'countries'
}
},
fields: [{name: 'id', type: 'int'}, {name: 'name', type: 'string'}]
});
var countryCombobox = new Ext.form.ComboBox({
fieldLabel: 'Страна',
id: 'country-combo',
store: countryStore,
disabled: true,
valueField: 'id',
displayField: 'name',
emptyText: 'Выберите страну…',
queryMode: 'local',
editable: false
});
Json answer look like this:
{"countries":[{"id":"1","name":"Great Britain"},{"id":"2","name":"USA"}],"total":2}
Can I hide this loading panel?