[**BUG**] Add/Del Rows
Hi Alex,
I found a bad bug in add/del rows.
Its like when u delete any rows ur table data doenst work anymore.
I have a example to explain better:
Usage:
Insert rows and set the value for Total column, in cellEditEnded event the footer (total) will show the count of values. Remove the first row and then try add more and look at the count. Its messed up.
I need a fix please, help.
Tkz Alex.
I found a bad bug in add/del rows.
Its like when u delete any rows ur table data doenst work anymore.
I have a example to explain better:
<html>
<head>
<title>ActiveWidgets Bug</title>
<script src="../runtime/lib/aw.js"></script>
<link href="../runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head>
<body>
<style>
</style>
<span id="grid"></span>
<script>
var obj = new AW.UI.Grid;
obj.setId("grid");
obj.setHeaderText(["ID", "Description", "Total"]);
obj.setColumnCount(3);
obj.setCellEditable(true);
obj.setFooterCount(1);
obj.setFooterVisible(true);
obj.setFooterTemplate(new AW.Templates.Text, 2);
obj.setFooterText(function() { return "Total: " + mostraTotal(obj); }, 2);
obj.onCellEditEnded = function() {
obj.getFooterTemplate(2).refresh( );
}
obj.refresh( );
function mostraTotal( obj ) {
var tot = 0;
for(var i=0;i<obj.getRowCount();i++)
tot += Number(obj.getCellValue(2, i))
return tot;
}
var serial = 0;
function addRow() {
obj.addRow(serial++);
}
function delRow() {
if(obj.getCurrentRow() != -1) {
obj.deleteRow(obj.getCurrentRow());
obj.getFooterTemplate(2).refresh( );
}
}
</script>
<input type="button" value="addRow" onclick="addRow()" />
<input type="button" value="delRow" onclick="delRow()"/>
</body>
</html>
Usage:
Insert rows and set the value for Total column, in cellEditEnded event the footer (total) will show the count of values. Remove the first row and then try add more and look at the count. Its messed up.
I need a fix please, help.
Tkz Alex.
Pc (from Brazil)
February 11,