Firefox rendering issue in Ext JS

耗尽温柔 提交于 2020-02-25 08:18:05

问题


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();

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 ?


回答1:


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');
                        }
                    }
            }]


来源:https://stackoverflow.com/questions/32437127/firefox-rendering-issue-in-ext-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!