View Full Version : Change in define between 407 and 411???

7 Mar 2013, 5:32 PM
A user control that was being built using an xtype in 407 seems to be ignored once I upgraded to 411. I'm not sure why, but the constructor for the user control is not being called and no errors are being produced to indicate it isn't being found.

All I've changed is the libraries from 407 to 411 and with a quick perusal of the forums and the readme notes I don't see anything that might be causing this - probably because I'm not actually sure exactly what the problem is.

Here's what the define looks like.

Ext.define("my.personalPanel", {
extend: "Ext.Panel",
alias: "widget.personalPanel",
requires: ["Ext.Panel", "my.personalDetails"],

constructor: ...

and here is the xtype reference that isn't being built:

xtype: "personalPanel"

which is added to the items of a viewport.

8 Mar 2013, 4:37 AM
You don't need to list the class you're extending in the requires.

Are you using dynamic loading? Which ExtJS file are you using (it should be one ending with -dev)?

Do you see the file loaded in the Net/Network tab of your debugger?

Is the rest of the viewport working?

8 Mar 2013, 5:59 PM
I am not using dynamic loading. I am using ext-all-dev.js

The js file loads fine. There's definitely not an error in the file and the same code works with 407 (100% certain). When I switch to 411, however, the constructor is not called. There is no message indicating why and if ext can't find a class it produces a message - I've had that happen before. So I think it's finding the class, just not calling the constructor for some reason.

The only panel in the viewport is this panel. However, it does look like viewport is putting html into the output but just wrapper html. Viewport does not throw an error and the only item it has is this panel.

9 Mar 2013, 5:49 AM
You need to poke it with a stick, see what falls off.

Try switching the items from your custom panel to a standard panel:

items: [{
title: 'Title'

If that works, try adding both your item and a standard panel at the same time (with a suitable layout so they'll both show up).

How are you creating the viewport?

9 Mar 2013, 4:34 PM
This was how I was doing the viewport.

Ext.create('Ext.container.Viewport', {
layout: 'fit', items: _getPanels()

very simple (the _getPanels() returns an array of panels which is actually contains just the one above). I changed this to use a regular panel and it worked. Then I tried using my panel and the regular panel and my panel worked. So, I tried wrapping my panel in a container like so.

Ext.create('Ext.container.Viewport', {

layout: 'fit',
items: [{xtype: "container", layout: "fit", items: _getPanels()}]


And it works now. Why this would make it work? No idea.

However, I did notice I'm having a few other issues with this new version. Notably blank titles are appearing on panels where they weren't before and the accordion layout I use doesn't seem to function at all (not responding to a mouse click). Otherwise things seems to work.

I really dislike upgrading this product, I doubt any upgrade will be as bad as the one from 3 to 4 (which almost made me stop using this library) but each time I upgrade it seems to be an ordeal that costs me lots of time.


9 Mar 2013, 4:47 PM
Using layout "fit" with a number of components doesn't really make sense, because it's meant to size a single child item.

What type of layout are you trying to achieve?

9 Mar 2013, 4:56 PM
It's only fit because I know there's only one component at this time. However, the delivery mechanism is designed to allow me to add more panels at a later time. In actuality only one will be visible at any time.