PDA

View Full Version : Related Combobox



Rulila
7 Apr 2012, 4:53 AM
Sorry for my English ..:) i have 2 related combobox(on select 1 combobox, update content 2 combobox).
The data is loaded successfully and everything works, except ..
if 1) select any item from 1 combobox 2) Later, select any item(or expand combobox) from 2 combobox
3) Later, change selecting item from 1 combobox (after that loading image "loading.gif"). 4) Later expand 2 combobox.. We see window with text: "loading". But on the background, shows correct data

var MainForm;

Ext.onReady(function(){

MainForm=Ext.create('Ext.form.Panel', {
title: 'MainForm',
renderTo: Ext.getBody()
});

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

var LPUStore=Ext.create('Ext.data.Store', {
model: 'ComboboxModel',
storeId:"LPUStore",
proxy: {
type: 'ajax',
url : 'php/LPUCombobox.php',
reader: {
type: 'json',
root: 'data'
}
},
autoLoad: true
})
var SpecStore=Ext.create('Ext.data.Store', {
model: 'ComboboxModel',
storeId:"SpecStore",
proxy: {
extraParams: {lpu:''},
type: 'ajax',
url : 'php/SpecCombobox.php',
queryMode: 'local',
reader: {
type: 'json',
root: 'data'
}
}
})
var LPUCombobox = Ext.create('Ext.form.field.ComboBox', {
fieldLabel: 'Change LPU',
id:"LPUCombobox",
width: 500,
valueField: 'id',
displayField: 'name',
forceSelection: true,
store: "LPUStore",
queryMode: 'local',
triggerAction:'all',
listeners: {
select: function(combo, records)
{
SpecCombobox.setValue('');
SpecCombobox.getStore().load({params: {lpu:combo.getValue()}});
}
}
});
MainForm.add(LPUCombobox);

SpecCombobox = Ext.create('Ext.form.field.ComboBox', {
fieldLabel: 'Change Spec',
id:"SpecCombobox",
displayField: 'name',
valueField: 'id',
width: 500,
store: "SpecStore",
queryMode: 'local',
triggerAction:'all',
autoHeight: true,
listeners: {
}
});
MainForm.add(SpecCombobox);
});

How to remove this window ? Google debugger does not throw errors..

.33734

scottmartin
7 Apr 2012, 8:26 AM
To eliminate the loadMask on your combo:
listConfig: { loadMask: false }

Regards,
Scott.

skirtle
7 Apr 2012, 11:26 AM
I suspect you may be hitting a known bug in 4.0.7. Patch here:

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