Leron
Leron

Reputation: 9876

ExtJS learning tutorials. Cant create window

I'm following the tutorial for ExtJS 4.x but I can't figure out something. I have this class:

Ext.define('MyApp.LoginWindow', {
    extend: 'Ext.Window',

    title: 'Log in',

    initComponent: function() {
        Ext.apply(this, {
            items: [
                {
                    extend: 'Ext.Window',
                    title: 'Log in'
                },
            ]
        });

        MyApp.LoginWindow.superclass.initComponent.apply(this, arguments);
    }
});

which is in my app.js file. But I don't know how actually I can create a new window using this script in the file where I'm actually using this script. I guess it's something simple, but don't want to go ahead before figure this out.

Thanks Leron

Upvotes: 0

Views: 633

Answers (1)

sha
sha

Reputation: 17860

Your code basically doing one very little thing - extend your class from Ext.Window and change title of it. But you don't need your initComponent function as it is right now - it just doesn't make sense and doesn't do anything.

After you defined your class you can create an object by doing something like this:

var win = Ext.create('MyApp.LoginWindow', {

});
win.show();

Upvotes: 1

Related Questions