5

I'm having a LOT of pain trying to do something very simple : extend a jQuery UI widget, namely the autocomplete one.

Here is what I am doing :

(function($) {
    $.widget("my.autocomplete", $.extend({}, $.ui.autocomplete.prototype, {     
        _create: function() {
            $.Widget.prototype._create.apply(this, arguments);
        },
    }));
})(jQuery);

Of course, it doesn't work even though it is exactly what the official jQuery UI documentation recommends :

http://jqueryui.com/docs/Developer_Guide

Can someone help on this ? I'm confused and have been stuck for many hours now...

Thanks by advance,

Eric.

1 Answer 1

6

OK, I've found the answer after many hours of confusion :

$.ui.autocomplete.prototype._create.apply(this, arguments);

Instead of :

$.Widget.prototype._create.apply(this, arguments);

Working like a charm...

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

1 Comment

Thank you. I was trying the exact same method as you.

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.