PDA

View Full Version : Autosuggest



Hippje
11 Oct 2010, 1:04 AM
Hey!

I've made a autosuggest in a combobox. It works fine but there is only one small problem.
If you type: "Hell" it wil suggest "Hello", but if you type "ell" it won't suggest "Hello". How can I fix that?

Here's my code:


var combo = new Ext.form.ComboBox({
anchor: '95%',
typeAhead: true,
triggerAction: 'all',
hideTrigger: true,
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'id', 'sort_id', 'content' ],
data: [ 1, '1', 'Hello!'],
[ 2, '1', 'Yoo!'],
[ 3, '2', 'Byebye'],
[ 4, '2', 'Cya'],
}),
valueField: 'id',
displayField: 'content'
});



Hippje!

Condor
11 Oct 2010, 1:08 AM
This is not supported by default (here is the Feature request (http://www.sencha.com/forum/showthread.php?60878-OPEN-58-ComboBox-to-allow-custom-Store-filtering-on-local-query) with possible patch).

Animal
11 Oct 2010, 1:40 AM
This is becoming a very common request. I hope Sencha are incorporating configurable filtering into the Ext 4 ComboBox class. Because they don't show any sign of deep refactoring the 3.0 one.