Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget

Here is a simple view that i want to instantiate :

Ext.define('myapp.view.Home',{
    extend 'Ext.Panel',
    xtype : 'testpanel' ,
    config: {
        title:'home',
        iconCls:'home',
        cls : 'home',
        html: [
           '<h1> Hello Guys </h1>',
           '<p> some text goes here </p>'
        ].join("")
    }
});

i have added the view to my controller as follows :

Ext.define('myapp.controller.Main', {
    extend : 'Ext.app.Controller',
    views : ['Home'],
    ...
}

i have used the xtype in my application as follows:

items:[{
    xtype : 'testpanel'
},

Still I get this error :

Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget.testpanel

I appreciate your help.

like image 617
user1203861 Avatar asked May 25 '12 23:05

user1203861


1 Answers

I think you forgot to add this view in app.js - Ext.Application's "views" array. Do check.

like image 175
Swar Avatar answered Sep 28 '22 01:09

Swar