PDA

View Full Version : Combox won't select



UbuntuPenguin
6 Aug 2012, 6:01 PM
Hello Everyone,
I have a Combobox and it loads search results into its dropdownlist. I can see the contents of the dropdown list just fine, but when I select one it doesn't populate the 'selectedItem' part of the Combobox. I've tried each and every configuration I have found on the internet to no avail.

Any help is greatly

Here is the offending code.



Ext.require('KesslerAdmin.model.LineItemType');
ds = Ext.create('Ext.data.Store', {
model: 'KesslerAdmin.model.LineItemType',
proxy: {
type:'ajax',
url:'line_item_type/search_by_product_type.json',
reader:{
type:'json'
}
}
});
Ext.define('KesslerAdmin.view.items.LineItemLiveSearchCombobox', {
extend:'Ext.form.ComboBox',
alias:'widget.lineitemslivesearchcombobox',


initComponent:function () {
var me = this;
me.store = ds,
Ext.applyIf(me, {
displayField: 'product_type',
width: 500,
labelWidth: 130,
queryMode: 'local',
typeAhead: true,


listConfig: {
loadingText: 'Searching...',
emptyText: 'No matching line items found.',


getInnerTpl: function() {
return '<div class="search-item">' +
'<h3><span>{product_type}</span></h3>' +
'</div>';
}
}
});
me.callParent(arguments);
}
});

wozsoft
7 Aug 2012, 12:03 AM
Try including a valueField parameter.

eg. valueField: 'product_type',

or other value you want to have in the field after selection has been triggered

UbuntuPenguin
7 Aug 2012, 4:43 AM
No dice, all I get is a blinking cursor after a selection after setting valueField: 'product_type'.

scottmartin
7 Aug 2012, 10:13 AM
What if you change to :



itemTpl : '{product_type}'


Scott.