EasyUI Forum
May 07, 2024, 05:17:09 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Combobox for Autocomplete within any chars position  (Read 7928 times)
arma
Full Member
***
Posts: 110


View Profile
« 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.
« Last Edit: October 23, 2013, 01:12:08 AM by arma » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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;
}
});
Logged
arma
Full Member
***
Posts: 110


View Profile
« Reply #2 on: October 23, 2013, 06:04:48 PM »

Thanks stworthy  Grin
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!