Dojo Button不会在ContentPane中呈现

时间:2014-10-09 10:17:19

标签: javascript button dojo dijit.form

我想在ContentPane中有一个按钮,但我无法渲染它。我有相同的代码用于显示ContentPane中的按钮以及正文中的所有内容。第一个没有渲染,第二个没有渲染,所以它没有显示正确的方式,也没有触发事件。该按钮的代码是:

<button data-dojo-type="dijit/form/Button"  data-dojo-props="iconClass:'dijitIconTask', onClick:function(){ console.debug('clicked simple') }">Simple</button> 

代码:

<body class="claro">
    <button data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'dijitIconTask', onClick:function(){ console.debug('clicked simple') }">Simple</button>
    <div data-dojo-type="dijit/MenuBar">
        <div data-dojo-type="dijit/PopupMenuBarItem">
            <span>Sesión</span>
            <div data-dojo-type="dijit/DropDownMenu">
                <div id="btnLogout" data-dojo-type="dijit/MenuItem" data-dojo-props="">Salir</div>
            </div>
        </div>
    </div>

    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true" id="borderContainer">
        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="splitter:true, region:'left'" style="width: 15%;" id="leftPane">
            <div data-dojo-type="dijit/layout/ContentPane">
                <input id="agentFilter">
            </div>
            <div data-dojo-type="dijit/layout/ContentPane" id="peopleTreePane" style="height: 90%">
            </div>
        </div>
        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="splitter:true, region:'center'">
            <div id="appCenterTabContainer" data-dojo-type="dijit/layout/TabContainer" data-dojo-props="splitter:true, region:'center'">
                <div data-dojo-type="dojox/layout/ContentPane" title="Visitas" href="" id="visitasPanel">
                    <div>
                    <button data-dojo-type="dijit/form/Button"
                        data-dojo-props="iconClass:'dijitIconTask', onClick:function(){ console.debug('clicked simple') }">
                        Simple
                    </button>
                    </div>
                </div>
                <div data-dojo-type="dojox/layout/ContentPane" title="Logs" href="" id="logsPanel">
                    <div id="gridLogs" class="appGrid" style="height: 20em;"></div>
                </div>
            </div>
        </div>
    </div>
</body>

由于

2 个答案:

答案 0 :(得分:1)

看起来ContentPane上的空href属性让Dojo的解析器感到困惑。除非您希望ContentPane从服务器加载其内容,否则您不需要该属性。

<div data-dojo-type="dojox/layout/ContentPane" title="Visitas" href="" id="visitasPanel">
                                                          <!-- ^ remove this -->

答案 1 :(得分:1)

你只是缺少borderContainer小部件的高度样式属性。

干杯, kiuma