-
24 Jul 2011 10:59 AM #1
Unanswered: Uncaught Attempting to create a component with an xtype that has not been registered:
Unanswered: Uncaught Attempting to create a component with an xtype that has not been registered:
Hello,
i try to create a draw component with sencha touch. But i get always the following error:
"Uncaught Attempting to create a component with an xtype that has not been registered: [object Object]"
What could that mean ?
Kind regardsCode:Ext.setup({ tabletStartupScreen: 'tablet_startup.jpg', phoneStartupScreen: 'phone_startup.jpg', tabletIcon: 'icon-ipad.png', phoneIcon: 'icon-iphone.png', glossOnIcon: false, onReady: function() { this.drawComponent = Ext.create('Ext.draw.Component', { xtype: 'chart', viewBox: false, items: [{ type: 'circle', fill: '#79BB3F', radius: 100, x: 100, y: 100 }] }); this.pnl = new Ext.Panel({ fullscreen : true, style: 'background-color: red;' }) ; this.pnl.show('pop'); } });
Jürgen
-
26 Jul 2011 1:16 AM #2
I don't know, if I'm getting it right, but isnt it mentionted in the drawing Examples? If I'm right i show you how I understand it:
I hope it would help you.PHP Code:new Ext.Application({
launch: function() {
// Create a draw component
var drawComponent = new Ext.draw.Component({
viewBox: false
});
// Create a window to place the draw component in
this.rootpanel = new Ext.Panel({
fullscreen:true,
layout: 'fit',
items: [drawComponent]
})
// 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!');
});
}
});
ps: sry for my bad englisch
-
27 Jul 2011 8:01 AM #3
Try to use "new Ext.draw.Component"-Syntax instead of Ext.create('...')-Syntax. It worked for me with Ext.chart.Chart.
-
27 Jul 2011 11:43 AM #4Jürgen Schaar
mobitecs UG
Mailänder Str. 2
30539 Hannover
Germany
Tel: +49 (0) 511 165968-54
Email: j.schaar@mobitecs.de
Internet: http://mobitecs.de
-
28 Jul 2011 7:17 AM #5
Thx Mobitex. Your code does work indeed.
Anyone knows why the draw component doesn't get displayed if I remove the myCircle.animate call? I tried adding a 'this.rootpanel.show(true)' but nothing gets displayed neither
-
2 Aug 2011 7:50 AM #6
Show does not seem to be working
Show does not seem to be working
I am seeing the same thing you are rando. The following code does not draw anything unless I add an animate call.
Code:new Ext.Application({ launch: function() { this.drawComponent = new Ext.draw.Component({ viewBox: false }); // Create a window to place the draw component in this.rootpanel = new Ext.Panel({ fullscreen:true, layout: 'fit', items: [this.drawComponent] }); // Add a circle sprite this.myCircle = this.drawComponent.surface.add({ type: 'circle', x: 400, y: 400, radius: 300, stroke: '#000000' }); this.myCircle.show(true); /* seems like this should do something */ } });
-
2 Aug 2011 8:23 AM #7Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
- Answers
- 17
Try using the renderFrame method on the surface you wish to paint.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote