未捕获错误:[Ext.createByAlias]无法创建无法识别的别名的实例:窗口小部件 [英] Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget
本文介绍了未捕获错误:[Ext.createByAlias]无法创建无法识别的别名的实例:窗口小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是一个简单的视图,我想实例化:
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'],
...
}
我已经使用xtype我的申请如下:
i have used the xtype in my application as follows:
items:[{
xtype : 'testpanel'
},
仍然收到此错误:
未捕获错误:[Ext.createByAlias]无法创建无法识别的别名的实例:widget.testpanel
我感谢你的帮助。
推荐答案
我想你忘了在app.js中添加这个视图 - Ext.Application的views数组。检查。
I think you forgot to add this view in app.js - Ext.Application's "views" array. Do check.
这篇关于未捕获错误:[Ext.createByAlias]无法创建无法识别的别名的实例:窗口小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文