how to add an invisible ID ?
I am generating dynamic data, and I have to open a new window and show them with the selected ID.
could i do it?
Monte, Kozr
August 27,
That's easy, you just have to create a column with invisibility attribute, check this sample:
<style>
.active-controls-grid { table-layout:inherit; height: 100%; font: menu; }
.active-column-0 {width: 1px; background-color:#FFFFFF; visibility:hidden}
.active-column-1 {width: 220px; background-color:#FFFFCC;}
.active-column-2 {width: 120px;text-align: left; background-color:#FFFFFF}
</style>
When you define the style of your table, just add the visibility:hidden in the column you want to hide.
Check that width of the hidden column must be in 1 px, otherwise you'll see a blank column on your grid.
Hope this can help.
LoThar
September 10,
All right, that was easy...
But I having other problem... I want to set the value of the hidden cell at the selected row to a hidden html object.
Does anybody now how to do it?
Actually, I´m working with struts and jsp... So that´s why I want it.
Tkz.
Marcos Choma
September 14,
Ooh very fine... I found an example, so I´m posting it...
=======================
<html>
<head>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="c:\apps\java\activewidgets-grid-1.0.0-free\ActiveWidgets\runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" />
<script src="c:\apps\java\activewidgets-grid-1.0.0-free\ActiveWidgets\runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 35%; width:60%; font: menu;}
.active-column-0 {width: 1px; visibility:hidden}
.active-column-1 {width: 80px;}
.active-column-2 {width: 200px; background-color: threedlightshadow;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-column-5 {text-align: right;}
//rows highlitght
.active-row-highlight {background-color: threedshadow}
.active-row-highlight .active-row-cell {background-color: threedshadow}
</style>
</style>
<!-- grid data -->
<script>
var myData = [
["1", "MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
["2", "ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
["3", "SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
["4", "CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
["5", "KNM", "Konami Corporation (ADR)", "3,710.784", ".000", "4313"]
];
var myColumns = [
"Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"
];
</script>
</head>
<body>
<table border="1">
<tr><td>
<form>
txt 1<input type="text" id="txt1"/><br>
</form>
</td></tr> </table>
<script>
var obj = new Active.Controls.Grid;
obj.setRowCount(5);
obj.setColumnCount(6);
obj.setDataText(function(i, j){return myData[i][j]});
obj.setColumnText(function(i){return myColumns[i]});
var row = new Active.Templates.Row;
row.setEvent("onmouseover", "mouseover(this, 'active-row-highlight')");
row.setEvent("onmouseout", "mouseout(this, 'active-row-highlight')");
obj.setTemplate("row", row);
function printRowData(src){
var index = src.getProperty("row/index");
window.status = myData[index][0];
document.getElementById("txt1").value = myData[index][0];
}
obj.setAction("click", printRowData);
document.write(obj);
</script>
</body>
</html>
Marcos Choma
September 14,