I have a jQuery UI autocomplete setting to my taste and works fine, but there is one fatal flaw. In my autocomplete, I use a custom display like this example . I have something very similar, but with the exception ...
The only difference is that I have multiple autocomplete elements of the same class on the same page. Only the first element shows an additional row of data, the rest show only basic autocomplete.
I can get the desired result by simply repeating all these elements of the class and causing autocomplete on them, but I was hoping there was a better way to call it once and make it "just work".
This is how I add an extra line:
.data( 'autocomplete' )._renderItem = function( ul, item ) { return $( '<li></li>' ) .data( 'item.autocomplete', item ) .append( '<a>' + item.label + '<br/><small>' + item.desc + '<small></a>' ) .appendTo( ul ); };
I should note that I am not getting any exceptions in the console at all.
source share