The above is a good exmaple.
But I'm facing a problem if the result of search data are too few(I'm not sure this is the REAL problem?!) in HTML FRAME, the FIRST COLUMN of grid will be disappered. But no problem without FRAME.
Pls read the code below,
-------------------
frame.html
-------------------
<html>
<head>
<title>Grid</title>
</head>
<frameset rows="*,22" BORDER="0" FRAMEBORDER="0" FRAMESPACING="0">
<frame src="main.html" name="mainpg" noresize scroll="no">
<frame src="bottom.html" name="bottompg">
</frameset>
</html>
****************************
-------------------
bottom.html
-------------------
<html>
<head>
<title></title>
<style>
body, html, td {margin:0px; padding: 0px; overflow: hidden;font: menu;border: none;}
input {font: menu}
</style>
<script language="javascript">
<!--
function go2(pg, opt)
{
var fm = document.forms["mmfm"];
if (opt != "") fm.target = opt;
else fm.target = "mainpg";
fm.submit();
}
//-->
</script>
</head>
<body>
<form name="mmfm" action="main.html" target="mainpg" method="post">
<table width="100%">
<tr>
<td nowrap="nowrap">
Status
<select name="srhstatu" onchange="go2(this, '')" style="font:messagebox">
<option value=""></option>
<option value="1">All</option>
</select>
<input type="button" value="new window" onclick="go2('a', 'abc')" />
</td>
<td nowrap="nowrap"width="50"></td>
</tr>
</table>
</form>
</body>
</html>
************************
-------------------
main.html
-------------------
<HTML><HEAD>
<TITLE>Grid</TITLE>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<script src="../../runtime/lib/aw.js"></script>
<link href="../../runtime/styles/xp/aw.css" rel="stylesheet"></link>
<!-- grid format -->
<STYLE>.aw-grid-control {
BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT: menu; BORDER-LEFT: medium none; WIDTH: 100%; BORDER-BOTTOM: medium none; HEIGHT: 100%
}
.aw-column-0 {
WIDTH: 65px
}
.aw-column-1 {
WIDTH: 70px
}
.aw-row-1 {
BORDER-RIGHT: buttonshadow 1px solid
}
.aw-row-selector {
WIDTH: 16px; TEXT-ALIGN: center
}
.aw-grid-cell {
BORDER-RIGHT: buttonshadow 1px solid
}
.aw-grid-row {
BORDER-BOTTOM: threedlightshadow 1px solid
}
.aw-mouseover-row .aw-row-selector {
BACKGROUND: #ccc
}
</STYLE>
</HEAD>
<BODY>
<xml id=xmlDataOrder>
<Document>
<Invoice>
<invno>0002000</invno>
<itemno>0000468</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0001156</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0001172</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0001172</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0001173</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0001173</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0002390</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0006077</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0006078</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0006080</itemno>
</Invoice>
<Invoice>
<invno>0002000</invno>
<itemno>0012436</itemno>
</Invoice>
</Document>
</xml>
<SCRIPT>
// create ActiveWidgets data model - XML-based table
var table = new AW.XML.Table;
// get reference to the xml data island node
var xml, node = document.getElementById("xmlDataOrder");
// IE
if (window.ActiveXObject) {
xml = node;
}
// Mozilla
else {
xml = document.implementation.createDocument("","", null);
xml.appendChild(node.selectSingleNode("*"));
}
// provide data XML
table.setXML(xml);
// define column labels
var columns = ["Invoice", "ORDER NO"];
var flds = ["invno", "itemno"];
// create ActiveWidgets Grid javascript object
var obj = new AW.Grid.Extended;
obj.setHeaderCount(2);
for (i=0;i<flds.length;i++){
eval("var MyInp" + i + "= new AW.UI.Input");
eval("MyInp" + i + ".setId('" + flds[i] + "')");
document.styleSheets[document.styleSheets.length-1].addRule("#" + flds[i] , "width: 100%; height: 87%;");
eval("MyInp" + i + ".onControlTextChanged = function(){SearchFunction ()};");
}
obj.setHeaderText(function(i){
return eval("MyInp" + i ,i);
});
function SearchFunction(){
var boxes = document.getElementsByTagName("input");
var inp = "";
var qrystr = "?act=srh";
for (var i=0; i<boxes.length; i++) {
inp = boxes(i);
if (inp.value != "") {
qrystr = qrystr + "&" + inp.id + "=" + inp.value;
}
}
window.location = "
http://localhost:8080/inv.do"+qrystr;
return true;
}
obj.setHeaderText(columns, 0);
obj.setColumnCount(columns.length);
obj.setVirtualMode(true);
obj.setSelectionMode("single-row");
obj.setSelectorVisible(true);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
obj.setSelectorWidth(18);
obj.setFixedLeft(1);
obj.setRowCount(11);
obj.setCellModel(table);
document.write(obj);
</SCRIPT>
</BODY></HTML>
************************
Any help would be appreciated.
Thanks