2011-02-07 15 views
5

Çok basit bir şey yapmaya çalışan çok fazla ağrım var: jQuery UI widget'ını, yani otomatik tamamlamayı genişlet.jQuery UI widget'ı nasıl genişletilir _create yöntemi?

http://jqueryui.com/docs/Developer_Guide

Can birisi: Elbette

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

, bunun resmi jQuery UI belgelerine önerir tam olarak ne olduğu halde çalışmıyor: İşte

yapıyorum budur Bu konuda yardım? Kafam karışık ve ... şimdi saatlerce önceden tarafından

Teşekkür,

Eric sıkışmış edilmiştir.

cevap

6

Tamam, karışıklık birçok saat sonra cevap buldum:

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

yerine:

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

+0

teşekkür ederim ... bir cazibe gibi çalışmak. Seninle aynı yöntemi deniyordum. – Bodman