0

我正在从 1.8.3 升级到 1.9.1。构建顺利,但页面加载存在问题...加载时,dojo 无法解析 HTML 模板中的任何 dojoType 小部件。普通 DOM 节点还有其他附加点,这些附加点是可访问的,但 dojoType 节点的附加点是未定义的。我在这里浏览了 1.9 的更改,但运气不佳。有人有类似的经历吗?

这是堆栈跟踪:

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 在头部加载:

    <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>
4

1 回答 1

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>

那是你要找的吗?

于 2013-11-11T23:59:28.980 回答