Giter Club home page Giter Club logo

Comments (1)

schungx avatar schungx commented on June 19, 2024

You shouldn't extend Dijit.Form.Button as it is only a "declared" class without any actual code defining it. Therefore you get the not-found error.

Try this:

/// <reference path="dijit.d.ts" />

import widget = module("dijit/_Widget");
import button = module("dijit/form/Button");  // I assume this module exports a class which extends Dijit._Widget (which contains definitions of the set/get/watch methods and more)

class dfButton extends button { 
                         _setDisabledAttr(value) 
                        { 
                                this.set('readonly', value);
                                this._set('disabled', value);
                        }

                        _getDisabledAttr()
                        { 
                                return this.get('readonly');
                        }
}

export = dfButton;

There appears to be a TypeScript compiler bug that prevents this from being compiled though.

Also, beware that when you extend a Dojo class this way, you can no longer safely use this class with Dojo, because Dojo assumes that all classes are defined by itself and should contain a whole bunch of necessary features! You can only use this class within your own TypeScript programs.

from dojo-typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.