Note that there are some explanatory texts on larger screens.

plurals
  1. PODojo HorizontalLinearGauge after dijit .startup()
    primarykey
    data
    text
    <p>I am attempting to create a Dojo layout using this code:</p> <pre><code>require([ 'dijit/registry', 'dijit/layout/BorderContainer', 'dijit/layout/TabContainer', 'dijit/layout/ContentPane', 'dojo/store/Memory', 'gridx/core/model/cache/Sync', 'gridx/Grid', 'dojox/dgauges/components/default/HorizontalLinearGauge', 'dojox/charting/Chart', 'dojo/domReady!' ], function( registry, BorderContainer, TabContainer, ContentPane, Memory, Sync, Grid, HorizontalLinearGauge, Chart ) { Layout = new BorderContainer({ 'design' : 'headline', 'class': 'borderContainerLayout' }, 'dashboardLayout'); Layout.addChild(new ContentPane({ 'id': 'layoutRight', 'region' : 'right', 'content': '&lt;div id="days-between-purchases"&gt;&lt;/div&gt;', 'splitter': true })); Layout.startup(); var hlg = new HorizontalLinearGauge({ 'title': 'Purchase Cycle (Average # of days between purchases)', 'srcRefNode': 'abc', 'value': 20, 'class': 'gauge', 'noChange': true, 'width': 150, 'height': 150, 'min': 0, 'max': 100, }, registry.byId('days-between-purchases')); hlg.render(); </code></pre> <p>There is more code to add a center, left, etc to the BorderContainer, but the problem I'm getting is "Unable to get property 'nodeType' of undefined or null reference. From the DOM captured at the time, it seems that the layout is not yet rendered into the DOM, so it cannot find registry.byId('days-between-purchases'). I have tried about 10 different ways of trying to put this together to render the layout and gauge during run time and searched heavily for a solution, but have come up with nothing.</p> <p>What am I doing wrong? Do you know of a tutorial which shows how to fully render a layout with a gauge at runtime? Sample code?</p> <p>Thanks, in advance. </p> <p>FYI: I am using the latest version of dojo with this dojoConfig:</p> <pre><code>var dojoConfig = { baseUrl : "//ajax.googleapis.com/ajax/libs/dojo/1.9.1/", async : true, isDebug : true, parseOnLoad : false, //gfxRenderer: "svg,silverlight,vml", packages : [ { name : "dojo", location : "dojo" }, { name : "dijit", location : "dijit" }, { name : "dojox", location : "dojox" }, { 'name': 'gridx', 'location': '/resources/common/javascript/gridx' }] </code></pre> <p>};</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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. 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