Skip to content

Instantly share code, notes, and snippets.

@pneff
Created October 14, 2011 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pneff/1287934 to your computer and use it in GitHub Desktop.
Save pneff/1287934 to your computer and use it in GitHub Desktop.
Dojo build system example
<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 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