Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The easiest way would be to define your own module. Take a look at this tutorial first:</p> <p><a href="http://dojotoolkit.org/documentation/tutorials/1.7/modules/" rel="noreferrer">http://dojotoolkit.org/documentation/tutorials/1.7/modules/</a></p> <p>Now define your own module, e.g. "./js/mymodules/mymodule.js" (relative to HTML page):</p> <pre><code>define([ "dojo/dom-construct", "dojo/dom-attr", "dijit/form/FilteringSelect", "dojo/data/ItemFileReadStore", "dijit/form/ComboBox", "dijit/form/DateTextBox", "dijit/form/Select", "dojo/store/Memory" ], function (domConstruct, domAttr, FilteringSelect, ItemFileReadStore, ComboBox, DateTextBox, Select, Memory) { function fillReportTable(repId) { // a lot of code to create the table, consisting of SEVERAL functions function createNewRow(tbl) { ...} function function1 () {... } function function2 () {... } function function3 () {... } } function addEmptyRow() { // a lot of code to create the table, consisting of SEVERAL functions } // Return an object that exposes two functions return { fillReportTable: fillReportTable, addEmptyRow: addEmptyRow } }); </code></pre> <p>And use your module like this:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script&gt; var dojoConfig = { baseUrl: "./js/", packages: [ { name: "dojo", location: "lib/dojo" }, { name: "dijit", location: "lib/dijit" }, { name: "dojox", location: "lib/dojox" } ] }; &lt;/script&gt; &lt;script data-dojo-config="async: true" src="js/lib/dojo/dojo.js"&gt;&lt;/script&gt; &lt;/head&gt; ... &lt;script&gt; require([ "mymodules/mymodule" ], function (mymodule) { mymodule.fillReportTable(...); mymodule.addEmptyRow(...); }); &lt;/script&gt; </code></pre>
 

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