Search code examples
extjstabsextjs4

creating xtype in Ext.Define and calling it in TabPanel items:[]


I am new to extjs in general, specially to 4 version:

I have created a class:

Ext.define('MyPanel', {
    extend:'Ext.panel.Panel',
    views: ["MyPanel"],

    config: {
        width: 200,
        height: 300,
        title: "HELLO"
    },

    constructor:function(config) {
        this.initConfig(config);
        return this;
    },
    alias: 'widget.MyPanel'
});

Next, I want to call this class in form of XTYPE in a tabPanel items:[]:
I did like this:

items: [{
    title: 'Kontakt',
    id: 'kontaktTab',
    closable:true,
    closeAction: 'hide',
    layout: 'fit',
    items:[{
            xtype: "MyPanel"
        }]

No luck yet, all I get is : Cannot create an instance of unrecognized alias: widget.MyPanel"
You must think, what a noob.... ;-)

Someone please help!!!


Solution

  • Hrm, have you tried lowercasing your alias. I thought aliases were always stored and fetched lowercase, but not sure about it