$.widget( "custom.catcomplete", $.ui.autocomplete, { _renderMenu: function( ul, items ) { var that = this, currentCategory = ""; $.each( items, function( index, item ) { if ( item.category != currentCategory ) { ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); currentCategory = item.category; }; that._renderItemData( ul, item ); }); } });
When using jquery-ui 1.11.4, I receive an error in the console when hovering the category:
Uncaught TypeError: Cannot read property 'value' of undefined
I reproduced the problem here: http://jsfiddle.net/vf6kv1us/1/
Here is the fiddle for v1.10.4 without error: http://jsfiddle.net/vf6kv1us/2/
Is using catcomplete
discouraged?
In that case, I need to look for another solution.