Sorting problem with more than 5 rows???
Hi,
Im having a serious problem: grid does not sort when the number of rows (excl. header/footer) is > 5. Just copy/paste the following into an html page:
What am I doing wrong???
Thanks in advance, ciao!!
Fab
Im having a serious problem: grid does not sort when the number of rows (excl. header/footer) is > 5. Just copy/paste the following into an html page:
<html>
<head>
<title>Test Grid</title>
<link rel="STYLESHEET" type="text/css" href="css/iscust.css">
</head>
<body>
<script src="runtime/lib/aw.js"></script>
<h1>This one sorts</h1>
<style>
#myGrid { width: 400px}
#myGrid .aw-grid-row {height: 18px; 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", "1", "1", "1", "1", "1", "5"],
["ROW2", "2", "2", "2", "2", "2", "10"],
["ROW3", "3", "3", "3", "3", "3", "15"],
["ROW4", "100", "100", "100", "100", "100", "500"]
]
var myHeaders = [
["Header", "COL1", "COL2", "COL3", "COL4", "COL5", "Footer"]
]
var myFooters = [
["Footers", "106", "106", "106", "106", "106", "530"]
]
var obj = new AW.Grid.Extended;obj.setId("myGrid");obj.setControlSize(725, 112);
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");
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);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 3);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 4);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 5);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 6);
document.write(obj);
</script>
<br><br>nRows=6, W=725, H=112<br><br></div>
<h1>This one NOT!</h1>
<style>
#myGrid1 { width: 400px}
#myGrid1 .aw-grid-row {height: 18px; 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", "1", "1", "1", "1", "1", "5"],
["ROW2", "2", "2", "2", "2", "2", "10"],
["ROW3", "3", "3", "3", "3", "3", "15"],
["ROW4", "100", "100", "100", "100", "100", "500"],
["ROW1", "1", "1", "1", "1", "1", "5"]
]
var myHeaders = [
["Header", "COL1", "COL2", "COL3", "COL4", "COL5", "Footer"]
]
var myFooters = [
["Footers", "106", "106", "106", "106", "106", "530"]
]
var obj = new AW.Grid.Extended;obj.setId("myGrid1");obj.setControlSize(725, 130);
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(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);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 3);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 4);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 5);
obj.setCellValue(function(col, row){return parseFloat(myData[row][col].replace(/[^0-9.]/m, ""));}, 6);
document.write(obj);
</script>
<br><br>nRows=7, W=725, H=130<br><br></div>
</body>
</html>
What am I doing wrong???
Thanks in advance, ciao!!
Fab
Diabolik
February 1,