Wednesday, February 6, 2013

Dojo Calendar Samples

Find some examples on how to implement Dojo Calendar:
http://jsfiddle.net/kadirisani/JYVwZ/


Tuesday, February 5, 2013

Dojo's loader can load non-amd scripts

Question (Thanks to Raymond Wadkins) on Dojo's loader loading non-amd scripts:


If the parser auto-requires modules, it will always behave in a promise fashion



From the API documentation for Dojo/Parser:

If the parser auto-requires modules, it will always behave in a promise fashion and parser.parse().then(function(instances){...}) should be used.

This means that if the module included in a data-dojo-type hasn’t previously been required, then the parser will call require itself and attempt to load the file.  When it does this, then the parse runs asynchronously.   If the module needs to act on the parsed content, then the promise needs to be used.

Dojo Auto Require

As of Dojo 1.8, the parser supports auto require. If as the document is being parsed any of the constructors are missing in either data-dojo-type or data-dojo-mixins and that class name looks like a MID (e.g. contains a slash), the parser will attempt to require in those modules after it has finished scanning the DOM. This means that you do not explicitly have to require in classes in your declarative markup before the parser is invoked.