0
여기 두 개의 위젯이 있습니다.위젯을 확장하려고 할 때 오류가 발생하는 이유는 무엇입니까?
:
그런데 왜 "형식 오류 :의 생성자가 아닌"
나는 시도하고 'sb.baseApp'에서 'sb.textboxesApp'을 확장 할 경우 오류가 발생합니다? ??
위젯을 확장하는 방법이 아닙니까?
JQuery와 1.8.3 JQuery와 UI 1.10.3
여기 두 개의 위젯이 있습니다.위젯을 확장하려고 할 때 오류가 발생하는 이유는 무엇입니까?
:
그런데 왜 "형식 오류 :의 생성자가 아닌"
나는 시도하고 'sb.baseApp'에서 'sb.textboxesApp'을 확장 할 경우 오류가 발생합니다? ??
위젯을 확장하는 방법이 아닙니까?
JQuery와 1.8.3 JQuery와 UI 1.10.3
당신이 된 .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();
대단히 감사합니다. 그건 내 문제를 해결;) –