我正在从 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>