PDA

View Full Version : [FIXED]Cannot create an instance of unrecognized alias: widget.grid



oe.elvik
23 Feb 2011, 4:38 AM
xtype: 'grid' dos not work

evant
23 Feb 2011, 2:01 PM
I've added widget.grid as a secondary alias.

tdekoekkoek
23 Feb 2012, 9:29 AM
Where can I find the fix for this bug?

P.S. why do my Sencha forums not show up in English?

tdekoekkoek
23 Feb 2012, 10:43 AM
What are we supposed to use instead of alias? I read in the release notes that it has been deprecated in favor of xtype, but I tried using xtype and I still get the error message:

Cannot create an instance of unrecognized alias: widget.mainMenu


What is the best practice here? I understand that there is a bug fix for backward compatibility, but I don't even know how to get my code working the "new" way.

tdekoekkoek
24 Feb 2012, 7:39 AM
Does anyone have an answer for this? The release candidate is currently unusable for us.

Mahatma_Fatal_Error
7 Mar 2012, 8:19 AM
I need an answer, too.


I get the same error, although I used xtype instead of alias.

tdekoekkoek
7 Mar 2012, 8:22 AM
What we have found is the in the RC, all views have to be declared in the views config setting of our application controller. This was not necessary in prior releases. This fixed the problem for us after much trial and error.

wrstrader
27 Mar 2012, 7:00 AM
Thank you so much for this solution. As soon as I put the views in the config of the application controller, everything worked for me.

Jayson Monterroso
22 May 2012, 8:06 AM
I'm having the same problem..? I don't know how to fix this..?

wrstrader
22 May 2012, 9:44 AM
As I recall, the problem was that we needed to move our 'views' from the app.js to the controller specified by the app.js

For example: app.js (note: this isn't really a working example, just to illustrate the point)

Ext.onReady(
function(){
myapp = Ext.create('Ext.app.Application',{
name: 'App',
autoCreateViewport: true,
controllers:["SomeController"] }
});
myapp.getSomeController = function(){
return myapp.getController('SomeController');
}
}
);

SomeController.js

Ext.define("App.controller.SomeController",{
extend: "Ext.app.Controller",
models:[{models here}],
stores:[{stores here}],
views: [{views here}],
requires:[{required files here}],

{ functions here}

});

Notice that the models, stores, and views go in the controller, not the app.

Hope that helps.

cooleddie
23 May 2012, 6:48 PM
2# if right for example:
if I need use this item
items: [ {
xtype: 'photoList'
}
]

I can define in this way

Ext.define('Oreilly.view.photo.List', {


extend: 'Ext.Container',

xtype: ['photoList','widget.photoList'],

Jayson Monterroso
23 May 2012, 7:14 PM
Thank You now it Works:D