2015-02-07 80 views
0

我想使用Ext js创建窗口小部件,其中一个项目应该是一个画布。如何用Ext.draw.engine.Canvas创建Ext js构件作为一个项目?

当我试图添加一个项目为xtype: 'canvas',我收到以下错误。

Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. 
Missing required class: tree {stack: (...), 
message: "Ext.Loader is not enabled, 
so dependencies cannot …esolved dynamically. 
Missing required class: tree", 
isInstance: true, $className: "Ext.Base", configClass: function…} 

以下是我的代码片段:

Ext.widget({ 
     xtype : 'mz-form-widget', 
     itemId: 'shopableImage', 
     items: [ 
      { 
       xtype: 'canvas', 
       width: 750, 
       height: 470, 
       itemId: 'preview-container' 
      } 
     ], 

我怎么能包括帆布项目到我的窗口小部件面板? 我错过了什么?

+0

您是否在应用程序中包含绘图软件包? – 2015-02-08 05:47:57

回答

0

Canvas没有定义别名(xtype),所以不能像上面那样配置它。您可以使用Ext.create明确创建它,也可以转到上一级组件,例如SurfaceExt.draw.Container