I am trying to include a demo dijit widget in my template. However, I keep getting: “Dojo is not defined”. I tried to find an answer, but I couldn’t. This error is odd as the required dojo.js is indeed loaded by the browser.
What is not working is:
dojo.require("dijit.form.MultiSelect");
However, if I use other dojo modules doing:
require(["dojo/store/JsonRest" ...
It works.
I made pastebin of my template here: http://pastebin.com/9fm13pSP
Is this Dojo 1.7?
For that version, I think Dojo expects the functions
define()andrequire()to be defined in the global namespace.These functions are then used to require dojo itself. Your dojo.js may have all the libraries in it, but they might not be available to use until you explicitly
requirethem.This worked for me (using Dojo 1.7.2):