Created
October 14, 2011 18:39
-
-
Save pneff/1287934 to your computer and use it in GitHub Desktop.
Dojo build system example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div dojo-type="mycorp.mywidget">testing</div> | |
<script src="/dojo/dojo.js" | |
djConfig="parseOnLoad: true"></script> | |
<script>dojo.require("mycorp.mywidget");</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This file would to be in the mycorp directory */ | |
dojo.provide('mycorp.mywidget'); | |
dojo.require('dijit._Widget'); | |
dojo.requireLocalization("mycorp", "mywidget"); | |
dojo.declare('mycorp.mywidget', [dijit._Widget], { | |
postCreate: function() { | |
var i18n = dojo.i18n.getLocalization("mycorp", "mywidget"); | |
console.log("Widget initialized and got some i18n strings: %o", i18n); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment