PDA

View Full Version : Can only select first value in combobox (displayField/valueField)



wuschba
22 Nov 2010, 2:43 AM
Hello! I have a comboxbox like this. The problem: Everyting works fine (loading of store and so on), but after selecting a value from the dropdownlist and the dropdownlist closes, always the first value of the dropdownlist is displayed in the textfield. Any idea what the problem could be?



<input type="TEXT" name="mycombo" id="mycombo" style="width:100%;">
<script type="text/javascript">
Ext.onReady(function()
{
var kunde = new Ext.form.ComboBox({
applyTo:'mycombo',
width:400,
typeAhead:true,
forceSelection:true,
triggerAction: 'all',
selectOnFocus:true,
minChars:2,
displayField:'customer_lastname',
valueField:'customer_id',
value:'',
hiddenValue:'',
hiddenName:'hidden_customer',
tpl: '<tpl for=\".\"><div class=\"x-combo-list-item\">{customer_lastname}, {customers_firstname} - {entry_company} <small>{entry_postcode} {entry_city} {countries_name} ({customers_id})</small></div></tpl>',
inputType: 'html',
store: new Ext.data.Store(
{ autoLoad: true,
proxy: new Ext.data.HttpProxy(
{ url: '/get_customers.php',
method: 'POST'
}),
reader: new Ext.data.ArrayReader(
{ root: 'data',
totalProperty: 'total',
id: 0
},
[ { name: 'customers_id', type: 'string' },
{ name: 'customers_firstname', type: 'string' },
{ name: 'customer_lastname', type: 'string' },
{ name: 'customers_email_address', type: 'string' },
{ name: 'customers_company', type: 'string' },
{ name: 'customers_postcode', type: 'string' },
{ name: 'customers_city', type: 'string' },
{ name: 'customers_countrie', type: 'string' }
])
})
});
});
</script>