Code in DOJO1.6 and DOJO1.4.3 working differently

220 views Asked by At

I have the following code in DOJO1.6 and DOJO1.4. In 1.6 version it is working fine but but is not working in 1.4. The tabbed menus are getting displayed as just list. Please help me so that the code works fine in DOJO1.4 also.

<script src="/portal_dojo/v1.4.3/dojo/dojo.xd.js" djConfig="parseOnLoad:true">
</script>
<script type="text/javascript">
dojo.require("dijit.layout.TabContainer");
dojo.require("dijit.layout.ContentPane");
</script>
<div style="width: 350px; height: 300px">
<div data-dojo-type="dijit.layout.TabContainer" style="width: 100%; height: 100%;">
    <div data-dojo-type="dijit.layout.ContentPane" title="My first tab" selected="true">
        Lorem ipsum and all around...
    </div>
    <div data-dojo-type="dijit.layout.ContentPane" title="My second tab">
        Lorem ipsum and all around - second...
    </div>
    <div data-dojo-type="dijit.layout.ContentPane" title="My last tab" closable="true">
        Lorem ipsum and all around - last...
    </div>
</div>

1

There are 1 answers

5
Frode On

Support for HTML5 style data-dojo-xyz attributes were added in 1.5, so they won't be recognized by Dojo 1.4.

So instead of data-dojo-type="dijit.layout.TabContainer" you have to use dojoType="dijit.layout.TabContainer" (and equivalent for ContentPane, of course) for Dojo 1.4.

See example here: http://jsfiddle.net/froden/WyeRk/