Dojo: '; pathbj是null ';加载自定义dijit时出错

Dojo: "pathObj is null" error while loading custom dijit

本文关键字:自定义 dijit 出错 加载 pathbj Dojo null      更新时间:2023-09-26

我在加载自定义dijit时得到此错误。我以前机械地这样做过几次,但我从来没有遇到过这个错误。

这是代码:

dojo.provide("my.company.widgets.cells.Axon");
(function() {
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("my.company.widgets.cells.AxonHelper");
var AxonHelper = my.company.widgets.cells.AxonHelper;
dojo.declare("my.company.widgets.cells.Axon", [dijit._Widget, dijit._Templated], {
    postCreate: function() {
        console.debug("Axon#postCreate");
    }

});
})();

…我这样调用它:

dojo.require("my.company.widgets.cells.Axon");
...
var axon = new my.company.widgets.cells.Axon();

就是这样!控制台错误:" pathbj is null."

我错过了一些可能很明显的东西,我只是不知道它是什么

设置templatePathtemplateString属性可以解决这个问题:)