Chrome版本61会为document.documentElement.scrollHeight返回不同的结果

时间:2017-09-21 18:46:17

标签: javascript jquery css google-chrome treegrid

这个问题是问题Treegrid 9.3.11 not loading in chrome 61的延续,我检查了treegrid团队他们说, Chrome版本61为document.documentElement.scrollHeight返回不同的结果以获取可用的页面高度,因此这已被破坏。

要解决此问题,请不要使用Cfg MaxHeight属性,并通过窗口onresize中的JavaScript代码手动最大化网格高度。有人可以帮我解决这个问题吗?

treegridsample.js

var G;

function showGrid(layoutBonus)
{
    // Construct the treegrid instance.
    var D = new TDataIO();

    var url = URL_CONTEXT + "ShowTreeGrid.action";
    D.Layout.Url = "scripts/treegrid_9_3_11/treegrid_def.xml";

    if (layoutBonus)
    {
        D.Layout.Bonus = layoutBonus;
    }

    D.Data.Url = url;
    D.Debug = 1;
    D.Data.Timeout = 210;

    D.Page.Url = URL_CONTEXT + "LoadPage.action";
    D.Page.Format = "Internal";
    D.Page.Data = "TGData";
    D.Page.Timeout = 120;
    G = TreeGrid(D, "batchGrid");
}

$(document).ready(function()
{
    showGrid();
    // code to be added here
});

Html:
<!DOCTYPE html>
<html>
    <head>

        <!-- treegrid js -->
        <script src="scripts/treegrid_9_3_11/GridE.js"></script>

        <!-- jQuery, jQuery UI, jQuery plugins js -->
        <script src="scripts/jquery/jquery/jquery-3.1.1.min.js"></script>

        <!-- Treegrid Sample js -->
        <script src="scripts/treegridsample.js"></script>

    </head>
    <body>
            <div id="batchGrid" style="height:100%; width:100%;">
              </div>
    </body>
</html>

treegrid_def.xml

<Cfg id='batchTable' MainCol='Details'
     Sorting='0' Deleting='0' 
     Scrolling='1' ConstHeight='0' ConstWidth='1' MaxHeight='20'
     Paging='3' ChildPaging='3' PageLength='25'  Copying='1'
     RemoveCollapsed='2' 
     CopyFocused='0' 

     NoHScroll='0' Style='Modern' SuppressCfg='1' StandardTip='1'
/>

1 个答案:

答案 0 :(得分:2)

我认为这是Chrome中的一个错误。 我使用JQuery。 $(document).outerHeight(true)作为样本。