0

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.

JS Fiddle

1 Answer 1

1

Try using a later version of jquery. It works for me with 1.10 and 1.11

code unchanged

http://jsfiddle.net/L5uu393y/7/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.