기본 클래스 메서드를 호출하는 것이 제대로 작동하지 않는 것 같습니다. 나는 다음과 같은 설정이 있습니다 jQuery UI 위젯 - 객체에 메서드가 없습니다. _super
thesetwo 링크가 작동해야한다고 제안 this._super()
를 호출 할 때 다음과 같은 출력 및 오류를 생성--> name
Uncaught TypeError: Object # has no method '_super'
자바 스크립트
$.widget('tt.name1',{
_create: function() {
this.name = 'name'
console.log('-->', this.name);
}
});
$.widget('tt.name2',$.tt.name1, {
_create: function() {
this._super();
/*$.tt.name1.prototype._create.call(this);*/
this.name = 'name2'
console.log('-->', this.name);
}
});
$('.my').name1();
$('.my').name2();
을
아니요. 연결된 두 페이지 모두 WidgetFactory에서 추가 코드를 사용하여'_super' 작업을합니다. – Bergi
@Bergi : 사실이 아닙니다. 예제에서는 1.9에서 소개 된 위젯 팩토리를 사용합니다. 다른 것이 필요하지 않아야합니다. –