PDA

View Full Version : TypeError: 'null' is not a constructor (evaluating 'new c(a[0])')



rochbu
6 Nov 2011, 5:58 AM
I'm porting a small javascript html canvas app to Sencha touch.

The docs indicate you can use Ext.draw.Component and get access to basic graphics.

1st issue was Ext.Loader not enabled... so I've done that.

Next error is:
TypeError: 'null' is not a constructor (evaluating 'new c(a[0])')

source snippet is:
Ext.application({
name: 'Explore',


launch: function() {


Ext.Loader.setConfig({enabled : true});


var drawComponent = Ext.create('Ext.draw.Component', {
viewBox: false,
items: [{
type: 'circle',
fill: '#ffc',
radius: 100,
x: 100,
y: 100
}]
});

mitchellsimoens
6 Nov 2011, 9:46 AM
This is loading Ext.draw.Component:


Ext.Loader.setConfig({
enabled : true,
paths : {
Ext : '../sencha-touch-2.0.0-pr1/src'
}
});

Ext.application({
name: 'Explore',
launch: function() {
var drawComponent = Ext.create('Ext.draw.Component', {
viewBox: false,
items: [{
type: 'circle',
fill: '#ffc',
radius: 100,
x: 100,
y: 100
}]
});
}
});

Except Ext.draw.Sprite requires Ext.util.Animate which the src file isn't there so you will still error out.