[MethodChain is]

• Component


Component 상속(확장)

extend example 실행 : 다른 탭에 표시됩니다.

mc.namespace('my.group');
mc.component.Code.add('mycode', 'new my.group.MyClass', 'mainMyClass');
my.group.MyClass = function(opts){
    mc.widget.Widget.setOptions(this, opts);
    if (this.showTo) {
        this.mainMyClass(this.showTo);
    }
};
mc.extend(my.group.MyClass, mc.types.Type, {
    ccode: 'mycode',
    mainMyClass: function(showTo){
        this.showTo = showTo || this.showTo;
        this.mainType();
        mc.component.Component.isExec(this, 'mycode', this.showTo);
    }
});
게재된 소스는 다운로드 받은 MethodChain/examples/b1_Component 폴더에 있습니다.

extend() 형태에 맞게 작성하면 클래스를 상속(확장)받을 수 있습니다.
이에 대한 설명은 'extend example 실행'에 작성되어 있으므로 생략합니다.

이전 페이지