我正在嘗試使用Sencha Touch和Ext.draw.Component將畫布繪製到屏幕上。我無法做任何事情。Sencha Touch:Ext.draw.Component根本不工作
這是我的主視圖,它已被設置爲初始視圖。
Ext.define('Booking.view.panelOne', {
extend: 'Ext.Panel',
alias: 'widget.panelOne',
requires: [
'Booking.view.drawComponent'
],
config: {
itemId: 'panelOne',
ui: 'light',
layout: {
type: 'card'
},
scrollable: 'horizontal',
items: [
{
xtype: 'drawComponent'
}
]
}
});
這是我的draw.Component的代碼,我試圖用它來渲染基本形狀到屏幕上。
Ext.define('Booking.view.drawComponent', {
extend: 'Ext.draw.Component',
alias: 'widget.drawComponent',
config: {
docked: 'left',
height: '100%',
itemId: 'myComponent',
width: '100%'
},
initialize: function() {
this.callParent();
Booking.view.drawComponent.getSurface('main').add({
type: 'circle',
fill: '#79BB3F',
radius: 100,
x: 100,
y: 100
}).show(true);
Booking.view.drawComponent.surface.add({
type: 'circle',
fill: '#000',
radius: 100,
x: 300,
y: 300
}).show(true);
}
});
我對此深感不解,發現它很不愉快。任何幫助表示讚賞,謝謝。
也許你做錯了什麼......?控制檯中有任何錯誤? – 2013-05-03 16:51:14
http://new.senchafiddle.com/#VoFka/ – 2013-05-03 16:52:27