1.9升级:无法解析dojoType小部件

时间:2013-11-11 21:52:19

标签: dojo

我正在从1.8.3升级到1.9.1。构建顺利进行,但页面加载存在问题......在加载时,dojo无法解析HTML模板中的任何dojoType小部件。普通DOM节点还有其他连接点,并且可以访问这些连接点,但dojoType节点的连接点未定义。我在没有太多运气的情况下扫描了1.9变化here。有人有类似的经历吗?

这是堆栈跟踪:

myproj/views/_Home.js  <---- crashes here while attempting to 
                             read a widget's attach point in the template
dijit/_WidgetBase.js: line 541
dojo/_base/declare.js: line 203
dijit/_WidgetsInTemplateMixin.js: line 107
dojo/_base/declare.js: line 203
myproj/views/_Home.js: line 26 <--- Page loads with this widget... This is a 
                                    templated widget, and this line is the     
                                    this.inherited(arguments) of startup().

Dojo Loading in head:

    <script type="text/javascript" src="/static/tara/config.js?1384202981691"></script>
    <script type="text/javascript">
        var $appBaseUri = 'http://cms.mydemo.com';
        var dojoConfig = {
            parseOnLoad: false,
            dojoBlankHtmlUrl: "/static/cms/blank.html",
            uploaderPath: "/static/nocache/uploader.swf",
            locale: "en-gb",
            cacheBust: "1384202981691",
            debugAtAllCosts: true,
            isDebug: true,
            packages: $appconfig.devMode.packages               
        }
    </script>       
    <script type="text/javascript" src="/static/lib/dojo/dojo/dojo.js?1384202981691"></script>
    <script type="text/javascript">
        dojo.require("myapp._dojo");
        dojo.addOnLoad(function(){
            dojo.require("myapp._base");
            dojo.addOnLoad(function(){
                dojo.require("cms.models._all");
                dojo.require("cms._base");
            });
        });
    </script>

正在呈现的模板,home.html在下面。可以访问所有其他附加点,但不能访问“mainStack”和“windows”。

<div class="container" title="">
    <div dojoAttachPoint="header">
    <div dojoAttachPoint="headerInner">
        <div dojoAttachPoint="topNavNode">
        </div>
        <div dojoAttachPoint="mainDetails"></div>
        <div class="clear"></div>
        </div>
    </div>
    <div dojoAttachPoint="mainStack" dojoType="dijit.layout.StackContainer"></div>
</div>
<div dojoAttachPoint="windows" dojoType="myapp.layout.WindowContainer"></div>

1 个答案:

答案 0 :(得分:0)

你的问题相当含糊,但我会在这里假装你只需要用dojoType切换你的data-dojo-type属性......对于附加点和这样:

<div id="homeView" data-dojo-type="myproj/views/_Home" data-dojo-props="someProp:'someValue'"></div>

在你的小部件模板中:

<div>
    <div data-dojo-attach-point="someAttachPoint">...</div>
    ...
</div>

这就是你要找的东西吗?