PDA

View Full Version : Combobox with typeAhead search all test in tpl



tsluijter
26 Sep 2013, 4:40 AM
I have a combobox with a tpl config.



Ext.define('Private.view.case.Combo', {
extend : 'Ext.form.field.ComboBox',


initComponent : function() {


var me = this, config;


config = {
typeAhead: true,
fieldLabel : 'Customer',
store : 'Customer',
valueField : 'number',
displayField: 'lastName',
tpl: '<tpl for="."><div class="x-boundlist-item"><table><tr><td width="50">{number}</td>' +
'<td width="150">{firstName}</td>' +
'<td width="150" class="list-item">{lastName}</td>' +
'<td width="100">{birthdate}</td></tr></table></div></tpl>',
allowBlank: false,
width: 600
};


Ext.apply(me, config);


me.callParent();
}
});


When i type text in the combobox it will only search in the lastname column.
I would like to search in all the columns. Is that possible?

ettavolt
30 Sep 2013, 3:36 AM
Of course. Just override this method (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.ComboBox-method-onTypeAhead).