0

I am migrating some of dojo 1.6 code to dojo 1.8 and I could not get the layout to behave the same. So I stripped the code to bare minimum hoping to nail down the problem and ended up with 2 identical jsfiddles. I copied the code from one into another one... and yet one of them results in splitted dojo ContentPanes where the other one does not.

Example #1 (layout works): http://jsfiddle.net/mmlitvin/3onan361/17/

Example #2 (layout does not work): http://jsfiddle.net/mmlitvin/Lt0a2fhd/

HTML

<body class="claro">
<div data-dojo-type="dijit.layout.BorderContainer" id="mainBC">  

    <div data-dojo-type="dijit.layout.BorderContainer" id="splitBC" data-dojo-props="region:'center'">
        <div data-dojo-type="dijit.layout.ContentPane" id="topPane" data-dojo-props="region:'top'">SQL Statement and details</div>
        <div data-dojo-type="dijit.layout.ContentPane" id="leftPane" data-dojo-props="region:'center'">Left Pane</div>
        <div data-dojo-type="dijit.layout.ContentPane" id="rightPane" data-dojo-props="region:'right',splitter:'true',minSize:1" style="width:50%;">Right Pane</div>
    </div>

</div>

Javascript

debugger;
dojo.require('dojo.parser');
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.Dialog");

CSS

#mainBC {
height:600px;
}
#topPane {
height: 15px;
border:none;
padding:0px;

}

user3254414
  • 7
  • 1
  • 3

1 Answers1

0

They are not identical. If you click on Fiddle Options in the left menu, you'll notice that the working JSFiddle contains djConfig="parseOnLoad:true" in the Framework <script> attribute while the other one does not.

JSFiddle documentation states the following about this attribute:

Framework <script> attribute:
    An ability to add special attributes to the script tag loading the framework. 
    That would result with <script type="text/javascript" src="/js/lib/someframework.js" {attributes}></script>

This means that dojo/parser is not running when the page loads in your second JSFiddle. In your actual code, simply add the djConfig="parseOnLoad:true to your <script> tag.

Eric Alberson
  • 1,116
  • 1
  • 11
  • 23