My combobox data is loaded after the layout of the form.
var villeStore = new Ext.data.ArrayStore({ fields: [{name:'idVille'} ,{name: 'ville'}] }); var villeInput = new Ext.form.ComboBox({ fieldLabel: 'Ville', store: villeStore, valueField:'idVille', displayField:'ville', typeAhead: true, mode: 'local', triggerAction: 'all', emptyText:'Ville', width:100, id:'villeInput' });
The problem is that I need to display the last one from the repository, but even have the Field value, because when I click on the button, this is what I send to the server
I did this, but it does not work, it shows the last value of the store, but it does not matter
villeInput.store.on('load',function(store) { villeInput.setValue(store.getAt(villeInput.store.getCount()-1).get('ville')); });
source share