EasyUI Forum
November 07, 2025, 11:40:04 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 search word in middle of text/string  (Read 10763 times)
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« on: December 30, 2015, 03:54:39 AM »

I see the combobox only search value with prefix system..

How to make that able to find words in middle of string?
sample: open this http://www.jeasyui.com/demo/main/index.php?plugin=ComboBox&theme=default&dir=ltr&pitem=
then put wors "kota"
then we have no result..
although there are city that including word "kota"..that is Dakota

Thank you in advance

Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 30, 2015, 09:12:52 AM »

Please override the 'filter' function to define your customized filter rule.
Code:
$('#cc').combobox({
filter: function(q, row){
var opts = $(this).combobox('options');
return row[opts.textField].toLowerCase().indexOf(q.toLowerCase()) >= 0;
}
});
Logged
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« Reply #2 on: December 30, 2015, 07:51:39 PM »

okay its works Smiley

thank you

http://jsfiddle.net/aswzen/9geyLroz/
Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
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!