I am adding the autocomplete functionality to text box. Referring this jQuery autocomplete custom data plugin.
Without custom data code it is working fine. I have added following custom data code
.autocomplete( "instance" )._renderItem = function( ul, item ) {
return $( "<li>" )
.append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
.appendTo( ul );
};
it throws error as
no such method 'instance' for autocomplete widget instance
is there anything that I am missing.
I am using jQuery v1.11.2 and jQuery UI - v1.10.3
Updated the syntax for the new version: I think they are not using instance now.
$("#Id").autocomplete().data("uiAutocomplete")._renderItem = function( ul, item )
{
return $( "<li>" )
.append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
.appendTo( ul );
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With