I have a ComboBox with a remote JsonStore (autoload: true).
When i give the ComboBox a value it just shows the value and not the displayValue.
I also noted that the store fetches it's data twice.
Once when i open the form, a second time when i open the ComboBox
Code:
new Ext.form.ComboBox({
id: 'ExtId141',
fieldLabel: 'Bedrijf',
name: 'company_id',
margins: '5 5 5 5',
allowBlank: false,
msgTarget: 'qtip',
anchor: '-4',
value: '4',
editable: false,
forceSelection: true,
minChars: 0,
queryParam: '-1',
valueField: 'id',
displayField: 'company',
hiddenName: 'company_id',
mode: 'remote',
store: new Ext.data.JsonStore({
storeId: 'ExtId142',
root: 'items',
totalProperty: 'totalCount',
idProperty: 'id',
remoteSort: true,
fields: [{
name: 'id'
},
{
name: 'company'
}],
proxy: new Ext.data.HttpProxy({
url: '/dataManager/list/company'
}),
listeners: {
loadexception: function (a, request, response, error) {
if (Ext.decode(response.responseText).msg) {
errorMessage = Ext.decode(response.responseText).msg;
} else {
errorMessage = error.message;
}
Ext.MessageBox.alert('Error', errorMessage);
}
},
sortInfo: {
field: 'company',
direction: 'ASC'
},
autoLoad: true,
})
})
I found this thread which does offer a solution, however now the data gets fetched 3 times.
2 times on form load, 1 when you open up the ComboBox.
Does anybody have a solution that doesn't involve loading in the SAME data multiple times?
Thanks in advance!