如题,由于文字内容太多,我想固定控件的宽度,然后让控件的高度为'96.7%,超过时,出现下拉条。
       代码如下:
{
xtype: 'displayfield',
      name: 'info.content',
value:this.content,
anchor: '96.7%', 
height: 200             
} 在火狐中,是有下拉条的,但是在IE下却没有、同一条记录、这是为什么啊,谁能告诉我啊???在线等。谢过了,先。        

解决方案 »

  1.   

    问题是,我用火狐做的,测试通过,测试人员用的是IE浏览器,给我提出BUG了,就这个问题,我怎样解决啊
      

  2.   

    function getScreenSize = function()
    {
        var theWidth,theHeight;
        if (window.innerWidth) 
        { 
        theWidth = window.innerWidth 
        theHeight = window.innerHeight 
        } 
        else if (document.compatMode=='CSS1Compat') 
        { 
        theWidth = document.documentElement.clientWidth 
        theHeight = document.documentElement.clientHeight 
        } 
        else if (document.body) 
        { 
        theWidth = document.body.clientWidth 
        theHeight = document.body.clientHeight 
        } 
        var result = [theWidth,theHeight];
        return result;
    }
    用这个函数获得浏览器窗口高宽,兼容性好
      

  3.   

    anchor是什么作用?用其他的代替不行吗?
      

  4.   

    大哥,我用你的建议试过了,怎么还是不行那。
    代码如下:
    {            xtype: 'displayfield',
    name: 'info.content',
    value:this.content,
    //anchor: '96.7%', 
    renderer:getScreenSize
    //height: 200             
    }
    getScreenSize : function()
    {
        var theWidth,theHeight;
        if (window.innerWidth) 
        { 
            theWidth = window.innerWidth; 
            theHeight = window.innerHeight; 
        } 
        else if (document.compatMode=='CSS1Compat') 
        { 
            theWidth = document.documentElement.clientWidth; 
            theHeight = document.documentElement.clientHeight; 
        } 
        else if (document.body) 
        { 
            theWidth = document.body.clientWidth; 
            theHeight = document.body.clientHeight; 
        } 
        var result = [theWidth,theHeight];
        return result;
    }
      

  5.   

    [Quote=引用 3 楼 aspwebchh 的回复:]
    可以了,谢了,是我的引用写错了,谢过