PDA

View Full Version : First App (Override Error)



ivandres
31 Jan 2012, 10:05 AM
Hi!

I'm trying to create mi first application with Ext, (after a lot of reading) but i can't get this error away:


app.js


Ext.Loader.setConfig({
enabled: true,
paths : {
Myapp : "application/assets/javascript/application"
}
});

Ext.application({
name: 'myapp',
launch:function(){
this.viewport = Ext.create("Myapp.AppLayout")
}
});


AppLayout.js


renderViewport = function() { Ext.create('Ext.Viewport',{
html: 'asasas'
});
}

Ext.define("Progo.Layout", renderViewport());


Everything renders fine, but this message appears into my javascript console:

TypeError: Cannot read property 'override' of undefined
i hope somebody knows!, thanks!

mitchellsimoens
31 Jan 2012, 11:12 AM
Couple things...


You don't need a path for Myapp, Ext.application will add a path in there for you.
The name of your Ext.application should be 'Myapp' not 'myapp'
Ext.define isn't being used correctly...



Ext.define('Myapp.AppLayout', {
extend : 'Ext.container.Viewport',
xtype : 'myapp-applayout',
....
});

Also, your naming convention is off. Your views should be in the Myapp.view namespace, controllers be in Myapp.controller, models in Myapp.model, and stores in Myapp.store and your folder structure should follow this...


app/
--controller/
--model/
--store/
--view/

ivandres
31 Jan 2012, 11:28 AM
Thanks mitchellsimoens,

Im going to use the Ext convention then and back to read all over again.