1

我正在尝试定义以下类,但它给了我一个错误:

错误:声明仪表板FloatingPane:mixin #0 不是可调用的构造函数。

define(["dojo/_base/declare", "dojo/dnd/move", "dojox/layout/FloatingPane"],
  function(declare, move, FloatingPane){
    return declare("dashboardFloatingPane", [move, FloatingPane], {

    constructor: function() {
            this.inherited(arguments);
            this.moveable = new dojo.dnd.move.constrainedMoveable(
                this.domNode, {
                    handle: this.focusNode,
                    constraints: function() {
                        var coordsWindow = {
                            l: 0,
                            t: 20,
                            w: window.innerWidth,
                            h: window.innerHeight                            
                        };
                        return coordsWindow;
                    }, within: true
                }
            );                            
        } 
    });
});

我错过了什么?

非常感谢

4

1 回答 1

2

在示例 #1 中,您尝试将dojo/dnd/move模块用作类的父级,而在示例 #2 中,您不是。

return declare("dashboardFloatingPane", [move, FloatingPane], {

对比

dojo.declare("dashboardFloatingPane", dojox.layout.FloatingPane, {

我不相信该dojo/dnd/move模块不是要继承的有效类,因此它不是可调用构造函数的错误。

于 2012-08-06T15:22:47.170 回答