admin 管理员组

文章数量: 1103785

本次遇到的状况是,firefox正常显示,360浏览器的极速模式下无法弹出窗体,chrome可以正常显示页面。
首先提供各个浏览器的版本信息


我们测试用的代码结构如下

文件夹结构如下

主要代码如下
viewport也就是入口

Ext.define('MyApp.view.MainVP', {
    extend: 'Ext.container.Viewport',
    alias: 'widget.mainvp',

    requires: [
        'Ext.toolbar.Toolbar',
        'Ext.button.Button',
        'Ext.tree.Panel',
        'Ext.tree.View'
    ],

    layout: 'border',

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'panel',
                    region: 'north',
                    height: 115,
                    itemId: 'topPanel',
                    title: '网站工具栏'
                },
                {
                    xtype: 'container',
                    region: 'west',
                    itemId: 'leftContainer',
                    width: 150,
                    items: [
                        {
                            xtype: 'toolbar',
                            height: 33,
                            itemId: 'leftToolBar',
                            items: [
                                {
                                    xtype: 'button',
                                    itemId: 'productBTN',
                                    text: '产品'
                                },
                                {
                                    xtype: 'button',
                                    itemId: 'systemBTN',
                                    text: '系统'
                                }
                            ]
                        },
                        {
                            xtype: 'treepanel',
                            height: 652,
                            itemId: 'leftTreeMenu',
                            title: '导航栏',
                            store: 'LeftTreeStore',
                            viewConfig: {

                            }
                        }
                    ]
                }
            ]
        });

        me.callParent(arguments);
    }

});

被弹出的窗体

Ext.define('MyApp.view.addNewCar', {
    extend: 'Ext.window.Window',
    alias: 'widget.addnewcar',

    requires: [
        'Ext.form.field.Text',
        'Ext.panel.Panel'
    ],

    height: 610,
    itemId: 'newCar',
    width: 628,
    title: '新增车型',

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'textfield',
                    fieldLabel: '产品',
                    emptyText: 'JSB_TESTLIB'
                },
                {
                    xtype: 'panel',
                    frame: true,
                    resizable: true,
                    collapsible: true,
                    title: '属性'
                }
            ]
        });

        me.callParent(arguments);
    }

});

左侧树形tab的数据来源store

Ext.define('MyApp.store.LeftTreeStore', {
    extend: 'Ext.data.TreeStore',

    requires: [
        'Ext.data.Field'
    ],

    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
            storeId: 'LeftTreeStore',
            root: {
                text: '产品',
                expanded: true,
                children: [
                    {
                        text: 'Honda',
                        expanded: true,
                        children: [
                            {
                                text: '雅阁',
                                leaf: true
                            },
                            {
                                text: '思域',
                                leaf: true
                            }
                        ]
                    },
                    {
                        text: 'Benz',
                        expanded: true,
                        children: [
                            {
                                text: 'S系列',
                                leaf: true
                            },
                            {
                                text: 'C系列',
                                leaf: true
                            }
                        ]
                    }
                ]
            },
            fields: [
                {
                    name: 'text'
                }
            ]
        }, cfg)]);
    }
});

主页面对应的controller

Ext.define('MyApp.controller.LeftController', {
    extend: 'Ext.app.Controller',

    productBTNFunction: function(target) {
        //Ext.Msg.alert("1");
        var carabc = Ext.create("widget.addnewcar");
        //Ext.Msg.alert("2");
        carabc.show();
        //Ext.Msg.alert("3");
    },

    init: function(application) {
        this.control({
            "mainvp #productBTN": {
                click: this.productBTNFunction
            }
        });
    }

});

下面我们看看不同浏览器的效果
chrome正常显示

firefox正常显示

妈蛋360的极速模式和兼容模式居然全都可以正常显示

难道是我之前测试的时候360浏览器用多了,缓存中保存了错误的与预期不相符合的数据吗?
反正现在正常了,妈蛋

本文标签: 浏览器 效果 ext