<html>
<head>
<title>Test Grid</title>
<link href="runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head>
<body>
<script src="runtime/lib/aw.js"></script>
<style>
#myGrid { width: 1000px}
#myGrid .aw-grid-row {height: 20px; border-bottom: 1px solid #ccc; font-size:10px; font-family: "Verdana";}
#myGrid .aw-grid-row a{font-size:10px; color: blue; font-family: "Verdana"; text-decoration:underline;}
#myGrid .aw-grid-row a: visited{font-size:10px; color: blue; font-family: "Verdana"; text-decoration:underline;}
#myGrid .aw-alternate-even {background: #fff;}
#myGrid .aw-alternate-odd {background: #eee;}
#myGrid .aw-mouseover-row {background: #ccc;}
#myGrid .aw-mousedown-row {background: #999;}
#myGrid .aw-rows-selected {background: #316ac5; font-weight: bold;}
#myGrid .aw-column-0 {width: 100px; border-right: 1px solid #ccc; background: #ebeadb; text-align:center; color: blue; font-weight: bold;}
#myGrid .aw-column-1 {width: 100px; text-align:center;}
#myGrid .aw-column-2 {width: 100px; text-align:center; border-left: 1px solid #ccc}
#myGrid .aw-column-3 {width: 100px; text-align:center; border-left: 1px solid #ccc}
#myGrid .aw-column-4 {width: 100px; text-align:center; border-left: 1px solid #ccc}
#myGrid .aw-column-5 {width: 100px; text-align:center; border-left: 1px solid #ccc}
#myGrid .aw-column-6 {margin-left: 0px; margin-right: 0px; width: 100px; border-left: 1px solid #ccc; background: #ebeadb; text-align:center; color: blue; font-weight: bold;}
#myGrid .aw-grid-row .aw-cells-selected {background: #316ac5;}
#myGrid .aw-grid-headers {color: blue;font-weight: bold;}
#myGrid .aw-grid-footers {color: blue;font-weight: bold;}
#myGrid .aw-footer-0 {background: #ebeadb; border-top:2px solid #cbc7b8;}
</style>
<script>
var myData = [
["ROW1", "<a href=\"#\">1_1</a>", "1_2", "1_3", "1_4", "1_5", "TOT1"],
["ROW2", "2_1", "2_2", "2_3", "2_4", "2_5", "TOT2"],
["ROW3", "3_1", "3_2", "3_3", "3_4", "3_5", "TOT3"],
["ROW4", "4_1", "4_2", "4_3", "4_4", "4_5", "TOT4"]
]
var myHeaders = [
["Header", "COL1", "COL2", "COL3", "COL4", "COL5", "Footer"]
]
var myFooters = [
["Footers", "F_1", "F_2", "F_3", "F_4", "F_5", "F_TOT"]
]
var obj = new AW.Grid.Extended;obj.setId("myGrid");obj.setFixedLeft(1);
obj.setFixedRight(1);
obj.setControlSize(700, 120);
obj.setVirtualMode(false);
obj.setCellText(myData);
obj.setHeaderCount(1);
obj.setHeaderText(myHeaders);
obj.setHeaderHeight(20);
obj.setFooterHeight(20);
obj.setFooterVisible(true);
obj.setFooterText(myFooters);
obj.setFooterCount(1);
obj.setColumnCount(7);
obj.setRowCount(4);
obj.setSelectionMode("single-row");
document.write(obj);
</script>
<br><br>nRows=6, W=700, H=120<br><br>
<style>
#myGrid1 { width: 1000px}
#myGrid1 .aw-grid-row {height: 20px; border-bottom: 1px solid #ccc; font-size:10px; font-family: "Verdana";}
#myGrid1 .aw-grid-row a{font-size:10px; color: blue; font-family: "Verdana"; text-decoration:underline;}
#myGrid1 .aw-grid-row a: visited{font-size:10px; color: blue; font-family: "Verdana"; text-decoration:underline;}
#myGrid1 .aw-alternate-even {background: #fff;}
#myGrid1 .aw-alternate-odd {background: #eee;}
#myGrid1 .aw-mouseover-row {background: #ccc;}
#myGrid1 .aw-mousedown-row {background: #999;}
#myGrid1 .aw-rows-selected {background: #316ac5; font-weight: bold;}
#myGrid1 .aw-column-0 {width: 100px; border-right: 1px solid #ccc; background: #ebeadb; text-align:center; color: blue; font-weight: bold;}
#myGrid1 .aw-column-1 {width: 100px; text-align:center;}
#myGrid1 .aw-column-2 {width: 100px; text-align:center; border-left: 1px solid #ccc}
#myGrid1 .aw-column-3 {width: 100px; text-align:center; border-left: 1px solid #ccc}
#myGrid1 .aw-column-4 {width: 100px; text-align:center; border-left: 1px solid #ccc}
#myGrid1 .aw-column-5 {width: 100px; text-align:center; border-left: 1px solid #ccc}
#myGrid1 .aw-column-6 {margin-left: 0px; margin-right: 0px; width: 100px; border-left: 1px solid #ccc; background: #ebeadb; text-align:center; color: blue; font-weight: bold;}
#myGrid1 .aw-grid-row .aw-cells-selected {background: #316ac5;}
#myGrid1 .aw-grid-headers {color: blue;font-weight: bold;}
#myGrid1 .aw-grid-footers {color: blue;font-weight: bold;}
#myGrid1 .aw-footer-0 {background: #ebeadb; border-top:2px solid #cbc7b8;}
</style>
<script>
var myData = [
["ROW1", "<a href=\"#\">1_1</a>", "1_2", "1_3", "1_4", "1_5", "TOT1"],
["ROW2", "2_1", "2_2", "2_3", "2_4", "2_5", "TOT2"],
["ROW3", "3_1", "3_2", "3_3", "3_4", "3_5", "TOT3"],
["ROW4", "4_1", "4_2", "4_3", "4_4", "4_5", "TOT4"]
]
var myHeaders = [
["Header", "COL1", "COL2", "COL3", "COL4", "COL5", "Footer"]
]
var myFooters = [
["Footers", "F_1", "F_2", "F_3", "F_4", "F_5", "F_TOT"]
]
var obj = new AW.Grid.Extended;obj.setId("myGrid1");obj.setFixedLeft(1);
obj.setFixedRight(1);
obj.setControlSize(708, 128);
obj.setVirtualMode(false);
obj.setCellText(myData);
obj.setHeaderCount(1);
obj.setHeaderText(myHeaders);
obj.setHeaderHeight(20);
obj.setFooterHeight(20);
obj.setFooterVisible(true);
obj.setFooterText(myFooters);
obj.setFooterCount(1);
obj.setColumnCount(7);
obj.setRowCount(4);
obj.setSelectionMode("single-row");
document.write(obj);
</script>
<br><br>nRows=6, W=708, H=128<br><br>
</body>
</html>
<html>
<head>
<title>Test grid</title>
</head>
<script src="runtime/lib/aw.js"></script>
<link href="runtime/styles/xp/aw.css" rel="stylesheet"></link>
<style>
#myGrid .aw-grid-separator {
background: none;
}
#myGrid .aw-header-0 .aw-grid-header {
border: none;
border-bottom: none;
background: none!important;
padding: 0px 0px 1px 0px;
}
#myGrid .aw-header-0 .aw-item-box {
border-bottom: none;
background: none;
}
#myGrid .aw-header-0 .aw-mouseover-header {
border-bottom-color: none;
background: none!imporant;
}
#myGrid .aw-header-0 .aw-mouseover-header .aw-item-box {
border-bottom-color: none;
background: none;
}
/* ======================================= */
/* alternate color for each row of data cells */
#myGrid .aw-alternate-odd {
background: #eee;
}
/* ======================================= */
/* each cell */
#myGrid .aw-grid-cell {
border-top: solid darkgray 1px;
border-left: solid darkgray 1px;
font-family: "Verdana";
font-size: 9px;
}
/* ======================================= */
/* row headers */
#myGrid .aw-gpanel-middle .aw-gpanel-left .aw-grid-cell {
background: #ced7ef!important;
text-align: left;
}
/* for spans in row headers */
#myGrid .aw-gpanel-left .aw-border-false {
border-top: none;
}
/* ======================================= */
/* column headers */
#myGrid .aw-grid-headers .aw-grid-header {
background: #ced7ef!important;
border-top: solid darkgray 1px;
border-left: solid darkgray 1px;
}
#myGrid .aw-grid-footers .aw-grid-footer {
background: #ced7ef!important;
border-top: solid darkgray 1px;
border-left: solid darkgray 1px;
}
#myGrid .aw-gpanel-top .aw-grid-header {
text-align: center;
}
#myGrid .aw-gpanel-left {
text-align: left;
}
/* for spans in column headers */
#myGrid .aw-gpanel-top .aw-border-false {
border-left: none;
}
/* per i link */
#myGrid .aw-grid-row a {
font-size:10px; color: blue; font-family: "Verdana"; text-decoration:underline;
}
#myGrid .aw-grid-row a: visited
{font-size:10px; color: blue; font-family: "Verdana"; text-decoration:underline;
}
/* Highlight on mouseover, mousedown */
#myGrid .aw-mouseover-row {
background: #ccc;
}
#myGrid .aw-mousedown-row {
background: #999;
}
/* Selected rows */
#myGrid .aw-rows-selected {
background: #316ac5; font-weight: bold;
}
</style>
<script>
var myData = [
["RT34MASS", "", "479"],
["RS21DGRS", "", ""],
["RL36EBMS", "", ""],
["RT62KCSM", "", "999"],
["RS23KGRS", "ASSENTE", ""]
]
var myHeaders = [
["MODELLO", "PRESENZA", "PREZZO"]
]
var myFooters = [
]
var myHeadersSpans = [
["1", "1", "1"]
]
var obj = new AW.Grid.Extended;obj.setId("myGrid");obj.setFixedLeft(1);
obj.setControlSize(308, 116);
obj.setVirtualMode(false);
obj.setCellText(myData);
obj.setHeaderCount(1);
obj.defineHeaderProperty("span", "1");
obj.setHeaderText(myHeaders);
obj.setHeaderSpan(myHeadersSpans);
obj.defineCellProperty("border", function(col, row){
if (this.getCellText(col, row) == ""){
return false;
}
else {
return true;
}
});
obj.getCellTemplate().setClass("border", function(){
return this.getCellProperty("border");
});
obj.defineHeaderProperty("border", function(col, row){
return (this.getHeaderSpan(col, row)) ? true : false;
});
obj.getHeaderTemplate().setClass("border", function(){
return this.getHeaderProperty("border");
});
obj.getHeaderTemplate().setStyle("width", function(col, row) {
var span = this.getHeaderProperty("span");
if (!span) return 0;
var i, w = 0;
for (i=0; i<span; i++) {
w += this.$owner.getColumnWidth( i + col );
}
return w;
});
obj.setHeaderHeight(18);
obj.setFooterHeight(18);
obj.setColumnCount(3);
obj.setRowCount(5);
obj.setSelectionMode("single-row");
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 1);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 2);
document.write(obj);
</script>
</body>
</html>
This topic is archived.