日期:2014-05-16  浏览次数:20304 次

extjs3——Ext.entend, IE, 未知的运行时错误

Extjs 3, 使用?ext-all-debug.js, 行4912 字符13

?

?

PerformancePanel = Ext.extend(Ext.Panel, {
    id: "performancePanelId",
    autoScroll:true,
    closable: false,

    initComponent: function() {

        var images = this.buildItems();       
        this.tbar = this.buildTBar();

        Ext.apply(this, {
            items: images
        });
        PerformancePanel.superclass.initComponent.apply(this, arguments);
    },
    buildItems: function() {
        return [
            {
                html:"<img src='performance!showImage.action?type=cpu"+urlExtraStr+" name='bindedItem' onerror='imgError(event)'/>",
                listeners:bindedItemListeners(false, false, false,false)
            }
        ]
    },
    buildTBar: function() {
        return {
            xtype: 'toolbar',
            items: [
                /*Note: here must use new Ext.Toolbar.Item(), otherwise, IE will cause  未知的运行时错误 ext-all-debug.js, 行4912 字符13
                 */
                new Ext.Toolbar.Item({
                    id: 'imgErrorId',
                    hidden: true,
                    html:'提示:<span style="color:#ff6633">该虚拟机一直处于关闭状态</span>'
                }),
                '->',
                getTimeSelectionRadioGroup()
            ]
        }
    },

?

其中,buildTBar中必须使用new Ext.Toolbar.Item(),否则如果直接使用如下,则会在IE中报错,而在firefox/chrom下运行正常。

?

 items:[{
                    id: 'imgErrorId',
                    hidden: true,
                    html:'提示:<span style="color:#ff6633">该虚拟机一直处于关闭状态</span>'
                } '->', getTimeSelectionRadioGroup()]