Pages

Wednesday 19 February 2014

extjs mvc

Ext.define('AM.view.Header', {
    extend: 'Ext.Component',
    dock: 'top',
    baseCls: 'app-header',
    initComponent: function () {
        Ext.applyIf(this, {
            html: 'Sample Extjs MVC Application'
        });

        this.callParent(arguments);
    }
});

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

Ext.application({
    name: 'AM',
    appFolder: 'scripts/app',

    controllers: [
'Users'
],

    launch: function () {
        Ext.create('Ext.container.Viewport', {
            layout: 'border',
            items: [{
                xtype: 'userlist',
                region: 'center',
                margins: '5 5 5 5'
            }, { region: 'north', dockedItems: [
                        Ext.create('AM.view.Header')]
            }]
        });
    }
});

No comments:

Post a Comment