I'm trying to extend ui.autocomplete by using widget factory:
$.widget( "custom.myautocomplete", $.ui.autocomplete, {
_renderItem: function( ul, item ) {
return $( "<li>" )
.text(item.label)
.appendTo( ul );
}
});
$(function() {
$("#inp").myautocomplete({
minLength: 1,
source: ["One","Two","Three","Four","Five"]
})
});
Searching works fine, but item selection does not work.
Try using a later version of jquery. It works for me with 1.10 and 1.11
code unchanged
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.