EasyUI Forum
May 06, 2024, 07:13:39 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: Combobox insensitive casse and contains search options on: February 23, 2012, 03:03:05 AM
Hi,

Thanks a lot.

It puts me on the way.

1- To handle insensitive casse, just override default filter like that (adding toUpperCase() or toLowerCase() and "== 0") :
Code:
$.fn.combobox.defaults.filter = function(q,row){
       var opts = $(this).combobox('options');
       return row[opts.textField].toUpperCase().indexOf(q.toUpperCase()) == 0;
};

2- To search inside the string like i wanted, just put ">= 0" like stworthy suggested
Code:
$.fn.combobox.defaults.filter = function(q,row){
      var opts = $(this).combobox('options');
      return row[opts.textField].toUpperCase().indexOf(q.toUpperCase()) >= 0;
};

For newbies like me, place these code outside of the jQuery $(document).ready scope, otherwise it don't works.

Thanks again, it works perfectly

Regards.
2  General Category / EasyUI for jQuery / Combobox insensitive casse and contains search options on: February 22, 2012, 08:26:57 AM
Hi,

I need to allow user make insentive and contains search unto combobox.

For example, if my options are :

  • Apple
  • Banana
  • Pineapple
  • Tomato

If used enter "apple", i need that both "Apple" and "Pineapple" appear in filter results.

It would be also very nice if i can highlight filter part on result.

How to achieve this ?

Regards.

PS : Sorry for my english, i'm french speaker.
3  General Category / EasyUI for jQuery / Combobox limit possibles values within the list (LimitsInList option) on: February 22, 2012, 08:14:23 AM
Hi,

I have a combobox of Customers for example. I need user to type a value for filter but i dont want it to enter inexisting value, since getValue return either a ID for option nor the value user typed.

In others words, i need a LimitsInList option. How can i achieve this?

Regards.

PS : Sorry for my english, i'm french speaker.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!