11 var proto = $.ui.autocomplete.prototype,
12 initSource = proto._initSource;
15 var matcher =
new RegExp( $.ui.autocomplete.escapeRegex(term),
"i" );
16 return $.grep( array,
function(value) {
17 return matcher.test( $(
"<div>" ).
html( value.label || value.value || value ).text() );
22 _initSource:
function() {
23 if ( this.options.html && $.isArray(
this.options.source) ) {
24 this.source =
function( request, response ) {
25 response(
filter( this.options.source, request.term ) );
28 initSource.call(
this );
32 _renderItem:
function(
ul,
item) {
33 return $(
"<li></li>" )
34 .data(
"item.autocomplete",
item )
35 .append( $(
"<a></a>" )[ this.options.html ?
"html" :
"text" ](
item.label ) )
function filter(array, term)