grid.setStyle('height', '80%');
and it work fine.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Content Management</title>
<link href="../runtime/styles/xp/aw.css" rel="stylesheet" type="text/css"/>
<script language="JavaScript" src="../runtime/lib/aw.js"></script>
</head>
<body >
<script>
var docGrid= new AW.UI.Grid;
docGrid.setId("FolderGrid");
var myHeaders = ["","Col1", "Col2", "Col3", "Col4","Col5","Col6","Col7"];
var colWidth = new Array(5,10,30,10,10,10,15,10); //set percentages for column width
docGrid.setColumnIndices([0,1,2,3,4,5,6,7]); // this hides the first column
docGrid.setColumnCount(8);
docGrid.setRowCount(200);
docGrid.setHeaderText(myHeaders);
docGrid.setCellData(function(col, row){return "cell " + col + "." + row});
docGrid.setCellTemplate(new AW.Templates.Radio, 0);
docGrid.setStyle('height', '80%');
docGrid.setStyle('width', '100%');
docGrid.setSelectionMode("single-row"); //set seletion for all the row
docGrid.onRowSelectedChanged = function(value, i){
this.getRowTemplate(i).refresh();
}
</script>
<table width="100%" height="100%" border="0" align="center" cellpadding="2" cellspacing="3">
<tr>
<td>
<DIV id="myDiv" width="100%" height="100%"></DIV>
</td>
</tr>
</table>
<script>
document.getElementById("myDiv").innerHTML = docGrid.toString();
</script>
</body>
</html>
docGrid.paint = function(){
var h = this.getScrollTemplate().element().offsetHeight;
this.setTimeout(function(){
this.setContentHeight(h, "total");
this._virtualController.paint.call(this);
});
}
This topic is archived.