2015-01-15 1 views

답변

0

당신이 된 .widget의 두 번째 인수로 위젯 자체를 통과하는 거 야 생각한다(). 문자열이 아닙니다. 여기에 내 시험이있다. http://jsfiddle.net/ho873kz4/

/**************************** 

Base Widget 

     Requires jQuery 
     Requires jQuery UI 

****************************/ 

(function($, undefined) { 
     'use_strict'; 



     /* 
     * A widget. 
     */ 
     $.widget('sb.baseApp', { 
       /* 
       * Widget Option 
       */ 
       options: {}, 



       /* 
       * Constructor, called once when first created 
       */ 
       _create: function() { 
        console.log('baseApp created'); 
       }, 

       /* 
       * Initialisation, called after _create and and on later widget calls. 
       */ 
       _init: function() { 
       }, 

       /* 
       * Destructor, cleanup when no longer needed. 
       */ 
       _destroy: function() { 
       } 
     }); 
} (jQuery)); 



/**************************** 

Textbox Widget 

     Requires jQuery 
     Requires jQuery UI 

****************************/ 

(function($, undefined) { 
     'use_strict'; 



     /* 
     * A widget 
     */ 
     $.widget('sb.textboxesApp', $.sb.baseApp, { 
       /* 
       * Widget Option 
       */ 
       options: {}, 



       /* 
       * Constructor, called once when first created 
       */ 
       _create: function() { 
        console.log('textboxesApp create'); 
        return this._super(); 
       }, 

       /* 
       * Initialisation, called after _create and and on later widget calls. 
       */ 
       _init: function() { 
       }, 

       /* 
       * Destructor, cleanup when no longer needed. 
       */ 
       _destroy: function() { 
       } 
     }); 
} (jQuery)); 

jQuery.sb.textboxesApp(); 
+0

대단히 감사합니다. 그건 내 문제를 해결;) –

관련 문제