dojo1.8无法在JsFiddle中显示BorderContainer和ConatentPane

时间:2013-02-04 06:11:53

标签: dojo

您好我无法在jsFiddle中显示BorderContainer和ContentPane虽然我能够在Firefox浏览器中显示。那我在jsfiddle中缺少什么?

这是jsfiddle中的work

<div id="main_bContainer" data-dojo-type="dijit/layout/BorderContainer"
data-dojo-props="design:'sidebar'">
<div class="cP_Left" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">ContentPane A</div>
<div class="cP_Right" data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region:'right'">ContentPane B</div></div>

require(["dojo/ready",
"dojo/_base/declare",
"dojo/dom-construct",
"dijit/_WidgetBase",
"dojo/dom",
"dojo/on",
"dojo/parser",
"dojo/domReady!"], function (ready, declare, domConstruct, _WidgetBase, dom, on, parser) {
ready(function ()
parser.parse(); // check out more!

}); 
});

克莱门特

1 个答案:

答案 0 :(得分:1)

你错过了几件事:

  1. 在你的dom周围打包<body class="soria">标签
  2. 关于soria主题的css链接错误
  3. 一些遗漏的括号。
  4. 我更新了jsfiddle

    DOM:

    <body class="soria">
        <div id="main_bContainer" data-dojo-type="dijit/layout/BorderContainer"
        data-dojo-props="design:'sidebar'">
            <div class="cP_Left" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">ContentPane A</div>
            <div class="cP_Right" data-dojo-type="dijit/layout/ContentPane"
            data-dojo-props="region:'right'">ContentPane B</div>
        </div>
    </body>
    

    代码:

    require(["dojo/ready",
        "dojo/_base/declare",
        "dojo/dom-construct",
        "dijit/_WidgetBase",
        "dojo/dom",
        "dojo/on",
        "dojo/parser",
        "dojo/domReady!"], function (ready, declare, domConstruct, _WidgetBase, dom, on, parser) {
        ready(function () {
            parser.parse(); // check out more!
        });
    });