Results 1 to 3 of 3

Thread: Error "items is undefined" with and Ext.Window where items config is well defined

  1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    84

    Question Error "items is undefined" with and Ext.Window where items config is well defined

    Hello,
    I've a problem with an Ext.Window. I create it with its item, a panel, and when I try to show it, I get the error "items is undefined" at line 18332 of ext-all-debug.js (I've the version 3.0.3 of ExtJS).

    I have created a new object extending the original Ext.Window for more flexibility:
    Code:
    var orderFormWindow = Ext.extend(Ext.Window, {
        initComponent: function() {
            Ext.apply(this, {
                title: 'New order',
                closable:true,
                width:1000,
                height:550,
                plain:false,
                autoScroll: true,
    
                items: [
                    new Ext.Panel()
                ]
            });
        }
    }
    
    var orderForm = new orderFormWindow();
    orderForm.show(this);
    The code has been simplified to be more clear, but I tested it in these conditions and the error appears too.

    When I remove the line "orderForm.show(this);", the error doesn't appear anymore, but obviously the window doesn't appear. To note that the "this" in this context is an Ext.Panel.

    I have noted that the error seems to be caused by the layout (I tried the default layout and the Border Layout, and the error is the same, in different lines).

    Thanks in advance for your answers!

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    you need to call the superclass.initComponent method.

    try:
    Code:
    var orderFormWindow = Ext.extend(Ext.Window, {
        initComponent: function() {
            Ext.apply(this, {
                title      : 'New order',
                closable   : true,
                width      : 400,
                height     : 550,
                plain      : false,
                layout     : 'fit',
                autoScroll : true,
    
                items: [
                    new Ext.Panel({
                        html  : 'myPanel in the middle'
                    })
                ]
            });
            orderFormWindow.superclass.initComponent.call(this);
        }
    });
    
    var orderForm = new orderFormWindow();
    orderForm.show(this);

  3. #3
    Ext User
    Join Date
    Jun 2009
    Posts
    84

    Default

    Thanks ! In effect, that was the problem, the object wasn't initialized...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •