EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: arma on October 22, 2013, 11:46:03 PM



Title: Combobox for Autocomplete within any chars position
Post by: arma on October 22, 2013, 11:46:03 PM
Hi,

How to make autocomplete in combobox, filter from any chars position, rather than match first chars typed (typeahead) ?
For example when i type 'do' it should show madona, dorothy and john doo

Thanks.


Title: Re: Combobox for Autocomplete within any chars position
Post by: stworthy on October 23, 2013, 04:57:52 PM
Try to override the combobox's filter function.
Code:
$('#cc').combobox({
filter: function(q, row){
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >= 0;
}
});


Title: Re: Combobox for Autocomplete within any chars position
Post by: arma on October 23, 2013, 06:04:48 PM
Thanks stworthy  ;D