Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs 4.1: So strange error: Uncaught TypeError: Cannot read property 'items' of undefined

Tags:

extjs

you can change sample: app/simple/app/Viewport.js to this:

you'll get this error in Chrome console:

Uncaught TypeError: Cannot read property 'items' of undefined ext-all.js:18 Ext.cmd.derive.getDockedItems

But if you comment this:

initComponent : function() {
                            this.callParent();
                        },

Everything is ok.

Ext.define('AM.view.Viewport', {
        extend : 'Ext.container.Viewport',

        layout: 'border',
        items : [{
                    border : false,
                    region : 'north',
                    xtype : 'progressbar',
                    text : 'Ready',
                    height : 20
                }, {
                    region : 'west',
                    xtype : 'userlist',
                    width:300
                }, {
                    region : 'center',
                    xtype : 'treepanel',
                    initComponent : function() {
                        this.callParent();
                    },
                    columns : [{
                                xtype : 'treecolumn',
                                sortable : false,
                                width : 200,
                                text : 'lala',
                                dataIndex : 'text'
                            }, {
                                flex : 1,
                                sortable : false,
                                text : 'haha',
                                dataIndex : 'pars'
                            }]
                }]
    });
like image 800
user2865062 Avatar asked Oct 21 '22 23:10

user2865062


1 Answers

1- try to call with the Parents arguments like this:

.
.
.
,initComponent : function() {
 this.callParent(arguments);
 },
.
.
.

OR call the the super Class:

.
.

,initComponent : function() {
     this.callSuper(arguments);
 },
.
.
.
like image 104
foued611 Avatar answered Oct 30 '22 23:10

foued611