Ext JS中的Firefox渲染问题 [英] Firefox rendering issue in Ext JS

查看:119
本文介绍了Ext JS中的Firefox渲染问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

var win = Ext.create('Ext.window.Window', {
         title: "Window",
         modal:true,
         width: 570,
         height: 440,            
         layout: 'card',
         items:[{
                xtype: "panel",
                border: true,
                bodyBorder: true,
                title: 'Panel',
                bodyStyle: {
                        "background": "linear-gradient(to left, #fff , #6799ff)"
                },
                id: 'PanelID',
                items:[{
                        xtype: 'box',
                        id: 'BoxID',
                        title:'Box',
                        width: 558,
                        height: 325,
                        autoEl: {
                            tag: 'iframe'
                        },
                        listeners: {
                            'boxready': function() {

                             var popWindowdoc = Ext.getCmp('BoxID').el.dom.contentDocument;
                             $(popWindowdoc.body).append('<div id="t" tabindex="0"/>');
                            $(popWindowdoc.getElementById('t')).append('This is Test');
                            }
                        }
                }]
            }
         ]


     });

     win.show();

这段代码在chrome中运行良好,我在我的窗口中得到这是测试。
但是在firefox中,我没有得到任何文本,没有发生错误。我认为这是一个渲染问题。

This code is working well in chrome and i am getting "This is Test" on my window. But in firefox I am not getting any text and no error is occurring . I think it is a render issue.

任何身体让我知道如何在这种情况下获得文本?

Any body let me know how i will get text in this condition ?

推荐答案

Firefox将解释这部分代码碎片,如果可能的话,您需要重构代码,只有一组括号 [{...}] 看看如何'2 项目?这只能是一个项目

Firefox will interpret this portion of your code fragmented, if at all possible you need to refactor your code in a way that there's only one set of brackets [{ ...}] See how there' 2 items? That's got to be only 1 items

 items:[{
            xtype: "panel",
            border: true,
            bodyBorder: true,
            title: 'Panel',
            bodyStyle: {
                    "background": "linear-gradient(to left, #fff , #6799ff)"
            },
            id: 'PanelID',
            items:[{
                    xtype: 'box',
                    id: 'BoxID',
                    title:'Box',
                    width: 558,
                    height: 325,
                    autoEl: {
                        tag: 'iframe'
                    },
                    listeners: {
                        'boxready': function() {

                         var popWindowdoc = Ext.getCmp('BoxID').el.dom.contentDocument;
                         $(popWindowdoc.body).append('<div id="t" tabindex="0"/>');
                        $(popWindowdoc.getElementById('t')).append('This is Test');
                        }
                    }
            }]

这篇关于Ext JS中的Firefox渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆