Editable Cells Issue
Hi Alex,
I am updating ActiveWidget Library from version 2.5.1 to 2.5.3 . During testing , i found that editable cells are not working as expected. Click on editable cell and enter some numeric value and then move to next cell. Try entering data , cell do not become editable unless you use mouseclick. Earliar , it becomes editable on keypress. I've attached a code to replicate mentioned issue. Attached code is working fine with version 2.5.1 but it behaves diffrently with version 2.5.3.
<html>
<head>
<title>ActiveWidgets Examples</title>
<script src="../runtime/lib/aw.js"></script>
<link href="../runtime/styles/xp/aw.css" rel="stylesheet"></link>
<style>
.aw-column-0 {width: 200px;text-align:left;}
.aw-column-1 {width: 120px;text-align:right;}
.aw-column-2 {width: 100px;text-align:right;}
</style>
<script>
var data = [
["Microsoft Corporation" , 314571.156 , 0.00],
["Oracle Corporation", 62615.27 , 0.00],
["SAP AG (ADR)" , 12.096 , 0.00] ,
["Computer Associates Inter" , 211231.006 , 0.00],
["IBM India" , 223571.156 , 0.00],
["Tata Consultancy Services", 62615.27 , 0.00],
["Wipro Software Labs" , 1222233.96 , 0.00] ,
["Infosys" , 121231.006 , 0.00]
];
function getGrid()
{
var columns;
var columnArray = ["Company Name","Market Value","Corrections"];
var gridObject = new AW.Grid.Extended;
gridObject.setId("gridObject");
gridObject.setStyle("width","100%");
gridObject.setStyle("height","200px");
gridObject.setColumnCount(3);
gridObject.setRowCount(data.length);
gridObject.setHeaderText(columnArray);
gridObject.setFixedLeft(0);
gridObject.setSelectionMode("single-cell");
var str = new AW.Formats.String;
var floatFormat = new AW.Formats.Number;
floatFormat.setTextFormat("#0.00");
gridObject.setCellFormat([str, floatFormat,floatFormat]);
gridObject.setFooterVisible(true);
gridObject.setFooterFormat([str, floatFormat,floatFormat]);
gridObject.setCellData(data);
gridObject.setCellEditable(true,2);
gridObject.onCellEditEnded = function(value , column, row){
var num = floatFormat.dataToText(Number(value));
gridObject.setCellText(num ,column , row);
var totalVal = 0 ;
for(var rowCount=0; rowCount<gridObject.getRowCount(); rowCount++) {
var val1 = parseFloat(gridObject.getCellText(2,rowCount));
totalVal +=val1;
totalVal = Math.round(totalVal*100)/100;
}
gridObject.setFooterText(gridObject.getFooterFormat(1).dataToText(totalVal),2,0);
gridObject.getFooterTemplate(2,0).refresh();
}
gridObject.onCellTextChanging = function(text, col, row){
//Used for validation - allows entering numeric value only.
}
gridObject.onCellClicked = function(event, column, row){
this.raiseEvent("editCurrentCell", event, column, row);
};
return gridObject;
}
</script>
</head>
<body>
<script>document.write(getGrid());</script>
</body>
</html>
Please analyze the above code and let me know what can be the solution.
Please consider it urgent.
I am updating ActiveWidget Library from version 2.5.1 to 2.5.3 . During testing , i found that editable cells are not working as expected. Click on editable cell and enter some numeric value and then move to next cell. Try entering data , cell do not become editable unless you use mouseclick. Earliar , it becomes editable on keypress. I've attached a code to replicate mentioned issue. Attached code is working fine with version 2.5.1 but it behaves diffrently with version 2.5.3.
<html>
<head>
<title>ActiveWidgets Examples</title>
<script src="../runtime/lib/aw.js"></script>
<link href="../runtime/styles/xp/aw.css" rel="stylesheet"></link>
<style>
.aw-column-0 {width: 200px;text-align:left;}
.aw-column-1 {width: 120px;text-align:right;}
.aw-column-2 {width: 100px;text-align:right;}
</style>
<script>
var data = [
["Microsoft Corporation" , 314571.156 , 0.00],
["Oracle Corporation", 62615.27 , 0.00],
["SAP AG (ADR)" , 12.096 , 0.00] ,
["Computer Associates Inter" , 211231.006 , 0.00],
["IBM India" , 223571.156 , 0.00],
["Tata Consultancy Services", 62615.27 , 0.00],
["Wipro Software Labs" , 1222233.96 , 0.00] ,
["Infosys" , 121231.006 , 0.00]
];
function getGrid()
{
var columns;
var columnArray = ["Company Name","Market Value","Corrections"];
var gridObject = new AW.Grid.Extended;
gridObject.setId("gridObject");
gridObject.setStyle("width","100%");
gridObject.setStyle("height","200px");
gridObject.setColumnCount(3);
gridObject.setRowCount(data.length);
gridObject.setHeaderText(columnArray);
gridObject.setFixedLeft(0);
gridObject.setSelectionMode("single-cell");
var str = new AW.Formats.String;
var floatFormat = new AW.Formats.Number;
floatFormat.setTextFormat("#0.00");
gridObject.setCellFormat([str, floatFormat,floatFormat]);
gridObject.setFooterVisible(true);
gridObject.setFooterFormat([str, floatFormat,floatFormat]);
gridObject.setCellData(data);
gridObject.setCellEditable(true,2);
gridObject.onCellEditEnded = function(value , column, row){
var num = floatFormat.dataToText(Number(value));
gridObject.setCellText(num ,column , row);
var totalVal = 0 ;
for(var rowCount=0; rowCount<gridObject.getRowCount(); rowCount++) {
var val1 = parseFloat(gridObject.getCellText(2,rowCount));
totalVal +=val1;
totalVal = Math.round(totalVal*100)/100;
}
gridObject.setFooterText(gridObject.getFooterFormat(1).dataToText(totalVal),2,0);
gridObject.getFooterTemplate(2,0).refresh();
}
gridObject.onCellTextChanging = function(text, col, row){
//Used for validation - allows entering numeric value only.
}
gridObject.onCellClicked = function(event, column, row){
this.raiseEvent("editCurrentCell", event, column, row);
};
return gridObject;
}
</script>
</head>
<body>
<script>document.write(getGrid());</script>
</body>
</html>
Please analyze the above code and let me know what can be the solution.
Please consider it urgent.
Ritu Sharma
March 3,