Seth
Seth

Reputation: 6260

Extending jQuery UI methods

I'm looking to see if it's possible to add methods or interactions to the jQuery UI library without editing the code itself? I want to be able to quickly upgrade as new versions come out, but still be able to add my own features that extend the base UI script.

Example:

I want to use the .dialog() method to have pointer tips to provide messaging to specific areas.

Is there an easy way to add this, or will I end up having to download the source and do it myself each time a release comes out?

Upvotes: 3

Views: 649

Answers (1)

Chris Laplante
Chris Laplante

Reputation: 29658

Access the UI widget's prototype:

var proto = $.ui.autocomplete.prototype;

proto.myNewMethodForAutocomplete = function(){
    // ...
};

You can also directy extend the prototype like this: How to extend a jquery ui widget ? (1.7)

Upvotes: 3

Related Questions