Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em>These remarks won't really fit in the comments section.</em></p> <p>I can't see the defect in your code, but here are some things to look at.</p> <p><strong>Notes on the AMD loader</strong></p> <p>Don't make assumptions about load order.</p> <pre><code>require(["foo", "bar", function (foo, bar) { // use foo and bar }); </code></pre> <p>Either <code>foo</code> or <code>bar</code> might be loaded and invoked first as loading is asynchronous. The only thing that is guaranteed is that they will both be loaded when the callback function is invoked. The thing <code>"foo"</code> resolves to is whatever its <code>define</code> function returns; if this is <code>undefined</code> ensure function is returning a value.</p> <p>Avoid circular dependencies.</p> <pre><code>//bar.js define(["foo"], function (foo) { return {}; }); //foo.js define(["bar"], function (bar) { return {}; }); </code></pre> <p>The behaviour is defined (see <a href="http://dojotoolkit.org/documentation/tutorials/1.7/modules/" rel="nofollow">documentation on modules</a>) but can be difficult to manage. Check that you don't introduce these through transitive dependencies (<code>A</code> -> <code>B</code> -> <code>C</code> -> <code>A</code>.)</p> <p>Load transitive template dependencies before trying to <a href="http://dojotoolkit.org/reference-guide/1.7/dojo/parser.html" rel="nofollow">parse</a> templates.</p> <pre><code>define(["dojo/_base/declare", "dijit/_WidgetBase", "dojo/parser", "dijit/form/Button" //need to load this even though it is //not referenced in the function ], function(declare, _WidgetBase, parser) { // pretend this is some custom template format (e.g. DTL) var template = "&lt;div data-dojo-type='dijit.form.Button'&gt;&lt;/div&gt;"; return declare("foo.Foo", [_WidgetBase, _TemplatedMixin], { postCreate: function() { this.domNode.innerHTML = template; parser.parse(this.domNode); } }); }); </code></pre> <p>Use the <code>_WidgetsInTemplateMixin</code> with <a href="http://dojotoolkit.org/documentation/tutorials/1.7/templated/" rel="nofollow">standard template widgets</a> where appropriate.</p> <p>Also, be sure to read the <a href="http://dojotoolkit.org/reference-guide/1.8/releasenotes/1.7.html" rel="nofollow">1.7 release notes</a> for gotchas and caveats.</p> <p><em>Note: this code is untested.</em></p> <hr> <p><em>As an aside, a trailing comma on an array will cause an error in IE7.</em></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload