Friday, April 19, 2013

Sencha app upgrade from 2.0.1 to 2.1.1


Sencha has changed the way the application gets launched. 
In 2.0.1, the app.js is new an object:
new Ext.Application({
    launch: function() {
        new Ext.Panel({
            fullscreen: true,
            dockedItems: [{xtype:'toolbar', title:'My First App'}],
            layout: 'fit',
            styleHtmlContent: true,
            html: '<h2>Hello World!</h2>I did it!'
        });
    }
});

while in 2.1.1, it just calls a method
Ext.application({
        launch: function () {
            Ext.create('Ext.Panel', {
                fullscreen: true,
                html: 'Hello World!'
            });
        }
    });

If you take a Sencha 2.0.1 app and upgrade it to 2.1.1, then you will need to update the related code to make it work properly.

No comments:

Post a Comment