无法调用undefined的方法'substring'

Arm*_*nce 1 tabs portal extjs extjs4

这是我的代码:

Ext.define('Ext.app.Portal', {
    extend: 'Ext.container.Viewport',

    uses: ['Ext.app.PortalPanel', 'Ext.app.PortalColumn', 'Ext.app.GridPortlet', 'Ext.app.ChartPortlet'],

    getTools: function () {
        return [{
            xtype: 'tool',
            type: 'gear',
            handler: function (e, target, panelHeader, tool) {
                var portlet = panelHeader.ownerCt;
                portlet.setLoading('Working...');
                Ext.defer(function () {
                    portlet.setLoading(false);
                }, 2000);
            }
        }];
    },

    initComponent: function () {
        var content = '<div class="portlet-content">' + Ext.example.shortBogusMarkup + '</div>';

        Ext.apply(this, {
            id: 'app-viewport',
            layout: {
                type: 'border',
                padding: '0 5 5 5'
            }, //eo layout
            items: [{ //app-header : item 1 of app-viewport
                id: 'app-header',
                xtype: 'box',
                region: 'north',
                height: 40,
                html: 'My Portal'
            }, { //container : item 2 of app-viewport
                xtype: 'container',
                region: 'center',
                layout: 'border',
                items: [{ //app-options: item 1 of container
                    id: 'app-options',
                    title: 'Options',
                    region: 'west',
                    animCollapse: true,
                    width: 200,
                    minWidth: 150,
                    maxWidth: 400,
                    split: true,
                    collapsible: true,
                    layout: 'accordion',
                    layoutConfig: {
                        animate: true
                    },
                    items: [{ //portal: item 1 of app-options

                        title: 'portal',
                        autoScroll: true,
                        border: false,
                        iconCls: 'nav'
                    }, { //settings : item 2 of app-options
                        title: 'Settings',
                        html: '<div class="portlet-content">' + 'details ??' + '</div>',
                        border: false,
                        autoScroll: true,
                        iconCls: 'settings'
                    }] //eo items app-options
                }, { //item 2 of container    
                    id: 'app-portal',
                    xtype: 'tabpanel',
                    activeTab: 0,
                    region: 'center',
                    items: [{
                        title: 'tab1',
                        layout: 'column',
                        html: 'this is the first tab',
                        closable: true
                    }, {
                        title: 'tab2',
                        closable: true
                    } //eo tab2
                    ] //eo items tabpanel

                }]
            }] //eo   app-portal
        }); //eo apply

        this.callParent(arguments);
    },

    onPortletClose: function (portlet) {
        this.showMsg('"' + portlet.title + '" was removed');
    },

    showMsg: function (msg) {
        var el = Ext.get('app-msg'),
            msgId = Ext.id();

        this.msgId = msgId;
        el.update(msg).show();

        Ext.defer(this.clearMsg, 3000, this, [msgId]);
    },

    clearMsg: function (msgId) {
        if (msgId === this.msgId) {
            Ext.get('app-msg').hide();
        }
    }

});
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激.

Jam*_*ark 6

对于其他可能会看到"无法调用未定义的方法'子字符串'的人来说,当我看到它时,通常是因为找到别名的问题.通常是坏xtype.例如,如果我使用xtype: 'img'而不是xtype: 'image'.我通过查看'instantiateByAlias'的堆栈跟踪来调试它,并查看该调用的参数.其中一个是配置中有问题的xtype.