<body>
<INPUT ID=inp TYPE=TEXT><INPUT TYPE=BUTTON VALUE=">" onClick="grid.style.display='inline';">
<script>
var obj = new Active.Controls.Grid;
obj.setRowProperty("count", 20);
obj.setColumnProperty("count", 5);
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});
obj.setRowHeaderWidth("28px");
obj.setColumnHeaderHeight("20px");
obj.setAction("click", function(src){inp.value = src.getItemProperty("text"); grid.style.display='none';});
document.write("<SPAN ID=grid STYLE='display: none;'>"+obj+"</SPAN>");
</script>
</body>
<script>
function toggle(theElem){
document.getElementById(theElem).style.display = (document.getElementById(theElem).style.display == 'none')?'':'none';
}
</script>
</head>
<body>
<br>
Test
<br>
<INPUT ID=inp TYPE=TEXT><INPUT TYPE=BUTTON VALUE=">" onClick="javascript:toggle('grid');">
<script>
var obj = new Active.Controls.Grid;
obj.setRowProperty("count", 20);
obj.setColumnProperty("count", 5);
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});
obj.setRowHeaderWidth("28px");
obj.setColumnHeaderHeight("20px");
var row = obj.getTemplate("row");
row.setEvent("ondblclick", function(){this.action("myAction")});
obj.setAction("myAction", function(src){inp.value = src.getProperty("item/index")});
document.write("<SPAN ID=grid STYLE='display: none; position: absolute; width: 400; height: 300;'>"+obj+"</SPAN>");
</script>
#grid {
display: none;
position: relative;
top: 1.3em;
left: -100px; /* size of the input box */
width: 200px;
height: 300px;
margin: 0px -200px -300px 0px;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<TITLE>grid.html</TITLE>
<link href="css/grid.css" rel="stylesheet" type="text/css" ></link>
<style>
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
#grilla {
display: none;
position: relative;
top: 1.3em;
left: -100px; /* size of the input box */
width: 200px;
height: 300px;
margin: 0px -200px -300px 0px;
}
</style>
<script LANGUAGE="JavaScript" src="js/grid.js"></script>
<script>
function toggle(theElem){
document.getElementById(theElem).style.display = (document.getElementById(theElem).style.display == 'none')?'':'none';
}
</script>
</head>
<body>
<br>
Test
<br>
<INPUT ID=inp TYPE=TEXT style="width: 100px;">
<INPUT TYPE=BUTTON VALUE=">" onClick="javascript:toggle('grid');">
<script>
var myData = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727", "4000"],
["SFTBF", "Softbank Corp. (ADR)", "14,485.840", ".000", "6865"],
["VRTS", "Veritas Software Corp.", "14,444.272", "1,578.658", "5647"],
["SYMC", "Symantec Corporation", "9,932.483", "1,482.029", "4300"],
["INFY", "Infosys Technologies Ltd.", "9,763.851", "830.748", "15400"]
];
var myColumns = [ "Ticker", "Company Name",
"Market Cap.", "$ Sales", "Employees" ];
var obj = new Active.Controls.Grid;
obj.setId("grilla");
obj.setRowProperty("count", myData.length);
obj.setColumnProperty("count", 5);
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});
obj.setRowHeaderWidth("28px");
obj.setColumnHeaderHeight("20px");
var row = obj.getTemplate("row");
row.setEvent("ondblclick", function(){this.action("myAction")});
obj.setAction("myAction", function(src){inp.value = src.getProperty("item/index")});
document.write("<SPAN ID=grid STYLE='display: none; position: absolute; width: 400; height: 300;'>"+obj+"</SPAN>");
</script>
</BODY>
</HTML>
This topic is archived.