2015-02-07 36 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

相關問題