在jquery.ui.autocomplete.js文件中,相应的位置添加(测试可行)下面的代码
//火狐 中文检索
.bind( "input.autocomplete", function( event ) {
if ( suppressKeyPress ) {
suppressKeyPress = false;
event.preventDefault();
}
clearTimeout( self.searching );
self.searching = setTimeout(function() {
// only search if the value has changed
if ( self.term != self.element.val() ) {
// console.log("self.term="+self.term+" self.element.val="+self.element.val());
self.selectedItem = null;
self.search( null, event );
}
}, self.options.delay );
})
设置option的minLength,可以在删除输入关键词后自动搜索所有的
options: {
appendTo: "body",
autoFocus: false,
delay: 300,
minLength: 0,
position: {
my: "left top",
at: "left bottom",
collision: "none"
},
source: null
},