EXTJS中 DateField 顯示一半的解決方案

來源:互聯網
上載者:User

只顯示了一半,巨鬱悶。 在網路上查了一下是IE8的問題,說需要執行一堆JS。[javascript]  解決方案:    放到DateField控制項調用之前就可以。(或放到ext-all.js中)    1. Ext.isIE8 = Ext.isIE && navigator.userAgent.indexOf('MSIE 8') != -1; //這句一定要加,如果版本不支援isIE8屬性的話  2. Ext.override(Ext.menu.Menu, {      autoWidth: function () {          var el = this.el, ul = this.ul;          if (!el) {              return;          }          var w = this.width;          if (w) {              el.setWidth(w);          } else if (Ext.isIE && !Ext.isIE8) {   //Ext2.1.1 支援 Ext.isIE8 屬性                 el.setWidth(this.minWidth);              var t = el.dom.offsetWidth;              el.setWidth(ul.getWidth() + el.getFrameWidth("lr"));          }      }  });   後來試了一下,不行。仔細分析後認為是頁面的HTML寫的問題。[html]  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <html>      <head>          <meta http-equiv="content-type" content="text/html; charset=UTF-8">          <meta http-equiv='X-UA-Compatible' content='IE=EmulateIE8' />   我刪除第一行後,介面顯示正常,萬惡的IE,自己搞這麼多標準。最後HTML如下:[html]   www.2cto.com<html>      <head>          <meta http-equiv="content-type" content="text/html; charset=UTF-8">          <meta http-equiv='X-UA-Compatible' content='IE=EmulateIE8' />    

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.