Extjs 未捕获的TypeError:无法读取未定义的属性Add

Extjs 未捕获的TypeError:无法读取未定义的属性Add,extjs,Extjs,嗨,我在执行我的代码后遇到了这个错误。它表示未捕获的TypeError:无法读取未定义索引的属性“add”。html:24 (匿名函数) index.html <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css"> <script type="text/javascript" src="ext-all.js"></script> </head> <

嗨,我在执行我的代码后遇到了这个错误。它表示未捕获的TypeError:无法读取未定义索引的属性“add”。html:24 (匿名函数)

index.html

<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css">
<script type="text/javascript" src="ext-all.js"></script>   
</head>
<body>
<script>
// Create a draw component
 var drawComponent = Ext.create('Ext.draw.Component', {
viewBox: false
});

// Create a window to place the draw component in
Ext.create('Ext.Window', {
width: 220,
height: 230,
layout: 'fit',
items: [drawComponent]
}).show();

// Add a circle sprite
var myCircle = drawComponent.surface.add({
type: 'circle',
x: 100,
y: 100,
radius: 100,
fill: '#cc5'
 });

// Now do stuff with the sprite, like changing its properties:
myCircle.setAttributes({
  fill: '#ccc'
 }, true);

// or animate an attribute on the sprite
myCircle.animate({
to: {
    fill: '#555'
},
duration: 2000
 });

 // Add a mouseup listener to the sprite
  myCircle.addListener('mouseup', function() {
  alert('mouse upped  ryru6!');
 });

//创建绘图组件
var drawComponent=Ext.create('Ext.draw.Component'{
视图框:false
});
//创建一个窗口以放置绘图组件
Ext.create('Ext.Window'{
宽度:220,
身高:230,
布局:“适合”,
项目:[组成部分]
}).show();
//添加一个圆形精灵
var myCircle=drawComponent.surface.add({
键入:“圆”,
x:100,
y:100,
半径:100,
填写:“#cc5”
});
//现在对精灵执行一些操作,例如更改其属性:
myCircle.setAttributes({
填充:“#ccc”
},对);
//或对精灵上的属性设置动画
myCircle.animate({
致:{
填写:“#555”
},
持续时间:2000年
});
//向精灵添加鼠标悬停侦听器
myCircle.addListener('mouseup',function(){
警惕('mouse upped ryru6!');
});
  • 我已经在SenchaExtJS文档网站上尝试了这段代码

    • 这里是输出图像的链接

  • 把它放在一个onReady块中。在你的图表示例中,我在这里使用饼图的代码si url::error i riecive:Uncaught ReferenceError:store1没有定义,所以在我错的地方,我使用了Ext.onReady函数。当出现任何搜索类型的Uncaught异常时,我应该采取哪一步来解决sencha中的错误这就是为什么我需要你的帮助。