PDA

View Full Version : [CLOSED] Uncaught Error: [Ext.create] Unrecognized class name / alias: widget.cartesian



sdruckerfig
6 May 2014, 4:02 AM
Upgrading an app and using charts compatibility mode in app.json:

"requires": [
"ext-charts"
]

The following error messages are output to console:

[W] [Ext.Loader] Synchronously loading 'widget.cartesian'; consider adding Ext.require('widget.cartesian') above Ext.onReady Util.js?_dc=1399377097357:679
GET http://localhost:1841/widget/cartesian.js?_dc=1399377101760 404 (Not Found) bootstrap.js:557
Uncaught Error: [Ext.create] Unrecognized class name / alias: widget.cartesian

Here's the class:




Ext.define('SpendingPortal.view.SponsorChart', {
extend: 'Ext.window.Window',
alias: 'widget.sponsorchart',


requires: [
'Ext.chart.Chart',
'Ext.chart.series.Column',
'Ext.chart.axis.Category',
'Ext.chart.axis.Numeric'
],


autoShow: true,
height: 320,
width: 501,
constrain: true,
layout: {
type: 'fit'
},
title: 'Compare Expenditures',


initComponent: function() {
var me = this;


Ext.applyIf(me, {
items: [
{
xtype: 'chart',
autoRender: false,
height: 250,
width: 400,
animate: true,
insetPadding: 20,
store: 'ChartData',
axes: [
{
type: 'Category',
fields: [
'label'
],
label: {
rotate: {
degrees: 45
},
renderer: function(s) {
return Ext.String.ellipsis(s,10);
}
},
title: 'Elected Representative',
position: 'bottom'
},
{
type: 'Numeric',
fields: [
'value'
],
label: {
renderer: Ext.util.Format.usMoney
},
title: 'Expenditures',
decimals: 0,
position: 'left'
}
],
series: [
{
type: 'column',
label: {
display: 'insideEnd',
field: 'value',
color: '#333',
'text-anchor': 'middle'
},
xField: 'label',
yField: 'value'
}
]
}
]
});


me.callParent(arguments);
}


});

mitchellsimoens
6 May 2014, 4:21 AM
Did you execute a build or app refresh?


sencha app refresh

or


sencha app build

or are using watch:


sencha app watch

sdruckerfig
6 May 2014, 4:26 AM
I did a sencha app refresh followed by a sencha app watch.

mitchellsimoens
6 May 2014, 4:39 AM
I'm not able to reproduce.

I generated a new app:


sencha generate app SpendingPortal ~/Sites/SpendingPortal

added your SpendingPortal.view.SponsorChart class to app/view/SponsorChart.js and required it. In the launch method I added:


Ext.create('Ext.data.Store', {
storeId : 'ChartData'
});
Ext.create('SpendingPortal.view.SponsorChart', {
autoShow : true
});

I added "ext-charts" to app.json and did a "sencha app refresh". Launched in browser and window showed, can see the Expenditures axis and I have no errors in the console.

48925

sdruckerfig
6 May 2014, 1:25 PM
Yeah, confirmed...not sure what the deal was with that one but it's now working for me as well. Sorry for the false reporting.