This question is a continuation on question Treegrid 9.3.11 not loading in chrome 61, I checked with treegrid team and they say, Chrome version 61 returns different result for document.documentElement.scrollHeight to get the available page height, hence this is broken.
To solve this just don't use the Cfg MaxHeight attribute and maximize the grid height manually by JavaScript code in window onresize. Can someone help me with the code for this?
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'
/>
I thing this a bug in Chrome. I use JQuery. $(document).outerHeight(true) as sample.