extjs用iframe的问题

项目中用extjs做前提
系统的界面是
左边用树做目录 右边用tabpanel做内容展示
点击树节点的时候 在tabpanel添加新的tab

JScript code
var newTab = centerPanel.add(new Ext.Panel({ id : tabId, title : tabTitle, iconCls : "treeNodeLeafIcon", layout : 'fit', border : false, closable : true, listeners : { activate : this.onActiveTabSize, scope : this }, items : { html : "<iframe width=\"100%\" height=\"100%\" scrolling=\"auto\" frameborder=\"0\" src=http://topic.csdn.net/u/20100715/14//""+_link+"\" ></iframe>" } }));

在ie6 ff下是正常的
不过就是在ie8下就出问题了
当iframe引用的页面是用viewport布局的时候就没有显示内容
点击别的tab再点击回来 viewport里面的内容有正常而来
如果点击树的节点的话viewport的内容又不见了
这个是不是extjs在ie8下的bug
有没有人遇到这个问题的呢

 
 
已经有8 个评论
    1. look 说:

      var newTab = centerPanel.add(new Ext.Panel({   id : tabId, //把id属性去掉试试   title : tabTitle,iconCls : "treeNodeLeafIcon",layout : ‘fit’,border : false,   closable : true,   listeners : {   activate : this.onActiveTabSize,   scope : this   },   items : {html : "<iframe width=\"100%\" height=\"100%\" scrolling=\"auto\" frameborder=\"0\" src=http://topic.csdn.net/u/20100715/14//""+_link+"/" ></iframe>"   }   }));

    2. my159 说:

      html: ‘<iframe id="iframe" src=http://topic.csdn.net/u/20100715/14//” + _link.url + ‘\’ frameborder="0" scrolling="auto" style="border:0px none;height:100%; width:100%;"></iframe>’

    3. wuwei04 说:

      CSS code

      如果id没有必须的用途,就不需要为组件添加id
      如果id一旦重复就会造成组件显示问题或是出现js冲突

    4. sbamd 说:

      试用了 还是老样子我这个代码在ie6和ff能正常跑的就是在ie8的时候出问题的

    5. jc2008_828 说:

      to 3id冲突的可能性不大   在ie6和ff下都正常有没有试过在ie8下 用tab调用iframe引用的页面用viewport的情况

    6. bobowanzi 说:

      弄了 几天 总算把问题解决了就是在页面上把第一句的doctype删掉就正常啦 这个问题只在ie8发生答案具体在这里http://bbs.misonsoft.com/thread-1941-1-1.html那这题当散分 来者有份  下周结贴

    7. 405290688 说:

      items : {html : "<iframe width=\"100%\" height=\"100%\" scrolling=\"auto\" frameborder=\"0\" src=http://topic.csdn.net/u/20100715/14//""+_link+"/" ></iframe>"   }这个写法我感觉有点问题,最好还是这样吧:items : [{html : "<iframe width=\"100%\" height=\"100%\" scrolling=\"auto\" frameborder=\"0\" src=http://topic.csdn.net/u/20100715/14//""+_link+"/" ></iframe>"   }]

    8. aw3fae 说:

      不是代码的问题,浏览器的问题,IE8是这样,我刚好前几天遇到过,我的解决方案是在首页加代码把IE浏览器的标准改了,无论客户用的什么IE,都是按照IE7的标准来的,希望对楼主有帮助在首页加入<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

posted @ 2014-07-21 16:57  郑文亮  阅读(2514)  评论(0编辑  收藏  举报