Skip to main content

Posts

Showing posts with the label notes

Debugging dojo

Recently I had an issue where I always get 3 as callback whenever I require a custom module. require(["modules/headerWidget"],function(header){ console.log(header); }); My headerWidget is something like this: require([ "dojo/_base/declare" , "dijit/_WidgetBase", "dijit/_TemplatedMixin" ], function(declare, _WidgetBase, _TemplatedMixin) { return declare("headerWidget",[ _WidgetBase, _TemplatedMixin ],{ templateString : <div></div> , }); }); Console always used to display only 3. I wondered as to why and here is the solution for that. The solution is to give the custom widget as module. define ([ "dojo/_base/declare" , "dijit/_WidgetBase", "dijit/_TemplatedMixin" ], function(declare, _WidgetBase, _TemplatedMixin) { return declare("headerWidget",[ _WidgetB...

Loading dojo in the project

In order to load Dojo, we can use CDN version or the downloaded package from  Dojo official site  and refer the src to Dojo package.