IE8无效参数

时间:2014-12-12 14:54:54

标签: internet-explorer-8 extjs4

我正在处理一些现有代码。升级到Extjs 4后,我们的应用程序视图窗口之一就被破坏了。它在Firefox上工作正常,而不是IE8。弹出窗口打开后,我得到Invalid参数,调试器指示它打开了,像Sytle [hook.name] = value;

我在阅读了一些帖子之后试图删除高度(我真的需要),但它仍然无效。请指教。

感谢。

Ext.define(view.window.popupwindow', {
    extend : 'Ext.Window',
    alias : 'widget.popupwindow',
    requires: [view.grid.issuerpopupgrid'],

    appContainer: undefined,
    caller: undefined,
    selReportType:undefined,
    reloadData: true,
    extraParam: undefined,

    initComponent: function() {
        var config = {              
            width: 750,
            minWidth: 600,
            minHeight: 300,
            autoScroll: false,
            modal: true,
            border: false,
            closable: true,
            constrain: false,
            resizable: true,
            maximizable: true,
            layout:'anchor',
            items: this.buildWindow(),
            listeners: {
                scope: this,
                show: function(form) {
                    //sync the shadow
                    var win = Ext.WindowMgr.getActive();
                    if (win!=null) win.el.sync(true);
                }
            }
        };
        Ext.apply(this, config);
        this.callParent(arguments);
    },

    buildWindow: function() {
        return [{
            xtype: 'issuerpopupgrid',
            id:'issuerpopupgrid-id',
            appContainer: this.appContainer,
            extraParam: this.extraParam
        }];
    },

}); 

Ext.define('view.grid.issuerpopupgrid', {
    extend : 'view.grid.lvsimplegrid',
    alias : 'widget.issuerpopupgrid',
    appContainer: undefined,
    extraParam: undefined,

    initComponent: function() {
        this.gridType =  this.appContainer.appContext.appData.gridDefTypeMap.R9;
        this.modelName = this.appContainer.name+'.model.'+this.gridType.name;
        this.selReportType = this.gridType.name; //'R9';
        this.sortField = 'secDesc';
        this.reportUrl = this.appContainer.appContext.appData["gridDefinitions"][this.gridType.name].serviceUrl;
        var config = {
            height: 570,
            selModel: {
                selType: 'checkboxmodel',
                showHeaderCheckbox :true,
                mode: 'MULTI',
                checkOnly: true
            },
            listeners: {
                scope: this,
                afterrender: this.onAfterRender,
                show: this.onActivateGrid
            }
        };
        Ext.apply(this, config);
        this.callParent(arguments);
        this.tbar = this.buildTopBar();
    },

    onAfterRender: function(thisObj) {
        this.configureGrid(this.selReportType, this.appContainer.appContext.appData, null, false, this.sortField, this.sortField);
        thisObj.getStoreData(this.selReportType, this.extraParam);
    },

    onActivateGrid: function(thisObj) {
        thisObj.getStoreData(this.selReportType); 
    }
});

1 个答案:

答案 0 :(得分:0)

看起来你有一个尾随逗号:

buildWindow: function() {
    return [{
        xtype: 'issuerpopupgrid',
        id:'issuerpopupgrid-id',
        appContainer: this.appContainer,
        extraParam: this.extraParam
    }];
}, //<-- trailing comma

IE将遇到此问题...您可以使用jsHint查找语法错误,如下所示:https://jslinterrors.com/extra-comma

这是完全提示的代码:

Ext.application({
    name : 'Fiddle',

    launch : function () {
        Ext.define('view.window.popupwindow', {
            extend : 'Ext.Window',
            alias : 'widget.popupwindow',
            requires: ['view.grid.issuerpopupgrid'],
            appContainer: undefined,
            caller: undefined,
            selReportType: undefined,
            reloadData: true,
            extraParam: undefined,
            initComponent: function () {
                var config = {
                    width: 750,
                    minWidth: 600,
                    minHeight: 300,
                    autoScroll: false,
                    modal: true,
                    border: false,
                    closable: true,
                    constrain: false,
                    resizable: true,
                    maximizable: true,
                    layout: 'anchor',
                    items: this.buildWindow(),
                    listeners: {
                        scope: this,
                        show: function () {
                            //sync the shadow
                            var win = Ext.WindowMgr.getActive();
                            if (win !== null) {
                                win.el.sync(true);
                            }
                        }
                    }
                };
                Ext.apply(this, config);
                this.callParent(arguments);
            },
            buildWindow: function () {
                return [{
                    xtype: 'issuerpopupgrid',
                    id: 'issuerpopupgrid-id',
                    appContainer: this.appContainer,
                    extraParam: this.extraParam
                }];
            }
        });

        Ext.define('view.grid.issuerpopupgrid', {
            extend : 'view.grid.lvsimplegrid',
            alias : 'widget.issuerpopupgrid',
            appContainer: undefined,
            extraParam: undefined,
            initComponent: function () {
                this.gridType =  this.appContainer.appContext.appData.gridDefTypeMap.R9;
                this.modelName = this.appContainer.name + '.model.' + this.gridType.name;
                this.selReportType = this.gridType.name; //'R9';
                this.sortField = 'secDesc';
                this.reportUrl = this.appContainer.appContext.appData.gridDefinitions[this.gridType.name].serviceUrl;
                var config = {
                    height: 570,
                    selModel: {
                        selType: 'checkboxmodel',
                        showHeaderCheckbox : true,
                        mode: 'MULTI',
                        checkOnly: true
                    },
                    listeners: {
                        scope: this,
                        afterrender: this.onAfterRender,
                        show: this.onActivateGrid
                    }
                };
                Ext.apply(this, config);
                this.callParent(arguments);
                this.tbar = this.buildTopBar();
            },

            onAfterRender: function (thisObj) {
                this.configureGrid(this.selReportType, this.appContainer.appContext.appData, null, false, this.sortField, this.sortField);
                thisObj.getStoreData(this.selReportType, this.extraParam);
            },

            onActivateGrid: function (thisObj) {
                thisObj.getStoreData(this.selReportType);
            }
        });
    }
});