PDA

View Full Version : Problem with a combo box



patagarru
9 Jun 2011, 2:01 PM
Hi all,
I have a problem with a comboBox the list of is empty

Following my code:

Store Definition

var DcmStoreCompany = Ext.extend(Ext.data.Store, {
constructor: function(cfg) {
cfg = cfg || {};
DcmStoreCompany.superclass.constructor.call(this, Ext.apply({
proxy: new Ext.data.HttpProxy({
url: 'example.jsp'
, method: 'POST'
}),
reader: new Ext.data.JsonReader({
root: 'company',
totalProperty: 'totalCount',
id: 'id',
fields: [{name: 'id', mapping: 'id'}
,{name: 'name', mapping: 'name'}]
}),
autoLoad: true,
id: 'storeCompany'
/*
url: 'example.jsp',
id: 'storeCompany',
root: 'company',
totalProperty:'totalCount',
fields: ['id','name']
*/
}, cfg));
}
});

Combo Definition

var DcmCmbCompay = Ext.extend(Ext.form.ComboBox, {
id: 'cmbCompany',
name: 'cmbCompany',
fieldLabel: etichette.company,
allowBlank: false,
store: new DcmStoreCompany(),
valueField: 'id',
displayField: 'name',
anchor: '100%',
initComponent: function() {
DcmCmbCompay.superclass.initComponent.call(this);
}
});

Thanks a lot
Fabio

skirtle
10 Jun 2011, 6:47 AM
Add triggerAction: 'all' to your combobox.