问题
I'm using Webix UI It allows to define the combo control like next
webix.ui({ view:"combo", options:["One", "Two", "Three"] });
It works fine, except of one moment. By default combo filters data by stat of text ( after typing "o", combo list will show only "One" option). How I need to change the above code to use full text filtering ( typing "o" must whow both "One" and "Two" options, as both of them contains the letter "o" )
回答1:
You can define a custom filtering method as part of options object
webix.ui({
view:"combo",
options:{
data:["One", "Two", "Three"],
filter:function(obj, filter){
//obj - combo option
//filter - current text in combo control
return obj.value.indexOf(filter) != -1;
},
}
});
来源:https://stackoverflow.com/questions/23151108/custom-filter-for-combo