Dojo: BorderContainer and ContentPanes not working inside of a custom widget template

时光毁灭记忆、已成空白 提交于 2019-12-05 19:20:56

I mixin the following in my custom widgets :

dijit.layout._LayoutWidget, dijit._Templated, dijit._Container

Container allows you to contain other dijits like BorderContainer. Templated allows you to put your widget markup in a html template. LayoutWidget allow you to get all the dijit layout and resize goodies.

If you are using dojo 1.4, templatePath can/should now be:

templateString : dojo.cache("test", "testWidget.html")

In your template you need a top level containerNode (this gets replaced by the dojo parser on widget creation I think) so testWidget's template would become:

<div dojoAttachPoint="containerNode" style="height:100%;">
<div id="page" dojoType="dijit.layout.BorderContainer" liveSplitters="true" design='sidebar' style="height:100%;width:100%;" dojoAttachPoint="subContainerWidget">
    <div dojoType="dijit.layout.ContentPane" region='center'>
            test center
    </div>
    <div dojoType="dijit.layout.ContentPane" region='left' style="width:50%">
            test left
    </div>
</div>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!