I'm using Jquery-ui version 1.10.3 with jQuery 1.8.3 and trying to implement a custom display of data fetched by the autocomplete server fetch:
This is the part that does the rendering override:
$(#"...").autocomplete(...)
.data( "ui-autocomplete")._renderItemData = function( ul, item : Users.BriefUserDescriptor) {
ul.data('ui-autocomplete-item', item);
return $( "<li>" )
.data('ui-autocomplete-item', item )
.append( "<p>" + item.fullName + "<br>" + item.emailAddress+ "</p>" )
.appendTo( ul );
};
This works. The elements are displayed as I want them to be, except for a problem regarding the focus:
focus: function( event, ui) {
var currentUser : Users.BriefUserDescriptor = ui.item;
$("#invitePersonInput" ).val(currentUser.fullName);
return false;
},
This always triggers an error, namely that currentUser (ui.item) is undefined.
I've tried several combinations of 'ui-autocomplete-item', 'uiAutocomplete', etc, but none has worked so far in this regard, some even failed to do the menu fill-in altogether.
Any hint would be great.