cannot cancel edit with complex selector
i have a fairly complex grid that can be edited. I also have an input field for each row in the selector.
i click on a cell to edit, enter new text. everything is fine. then i go to the input on the selector. if i type in anything, the grid cell is being edited instead.
i played with onSelectorClicked, onSelectorMouseDown but so far nothing has worked. i also tried calling cancelCellEdit() but it says its not a function?
here is the code that demonstrate this - modified from quickref:
<html>
<head>
<title>ActiveWidgets Examples</title>
<script src="../../runtime/lib/aw.js"></script>
<link href="../../runtime/styles/system/aw.css" rel="stylesheet"></link>
</head>
<body>
<style>
#myGrid { width: 400px}
#myGrid .aw-grid-row {height: 20px; border-bottom: 1px solid #ccc}
.aw-strict #myGrid .aw-grid-row {padding-bottom: 3px;}
/* Alternate row colors */
#myGrid .aw-alternate-even {background: #fff;}
#myGrid .aw-alternate-odd {background: #eee;}
</style>
<script>
var myData = [
['MSFT','Microsoft Corporation', '314,571.156', '32,187.000', '55000'],
['ORCL', 'Oracle Corporation', '62,615.266', '9,519.000', '40650'],
['DOX', 'Amdocs Limited', '4,288.017', '1,427.088', '9400'],
['CTXS', 'Citrix Systems, Inc.', '3,946.485', '554.222', '1670'],
['KNM', 'Konami Corporation', '3,710.784', '.000', '4313']
];
var myHeaders = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
var obj = new AW.Grid.Extended;
obj.setId("myGrid");
obj.setCellEditable(true);
obj.setHeaderText(myHeaders);
obj.setCellText(myData);
obj.setColumnCount(5);
obj.setRowCount(5);
obj.setSelectorVisible(true);
obj.setSelectorWidth(55);
obj.setRowHeight(25);
var rc = 1; // put a text input field on the selector
for (var i=0; i< 5; i++)
{
textStr = "<input type=text size=2 id='ord" + i + "' value='" + rc*10 + "'>";
obj.setSelectorText(textStr, i);
rc++;
}
document.write(obj);
// set the color if edited
obj.onCellTextChanged = function() {
obj.getCellTemplate(this.getCurrentColumn(), this.getCurrentRow()).setStyle("color", "red");
};
</script>
</body>
</html>
any idea what i can do? i am using 2.5
i click on a cell to edit, enter new text. everything is fine. then i go to the input on the selector. if i type in anything, the grid cell is being edited instead.
i played with onSelectorClicked, onSelectorMouseDown but so far nothing has worked. i also tried calling cancelCellEdit() but it says its not a function?
here is the code that demonstrate this - modified from quickref:
<html>
<head>
<title>ActiveWidgets Examples</title>
<script src="../../runtime/lib/aw.js"></script>
<link href="../../runtime/styles/system/aw.css" rel="stylesheet"></link>
</head>
<body>
<style>
#myGrid { width: 400px}
#myGrid .aw-grid-row {height: 20px; border-bottom: 1px solid #ccc}
.aw-strict #myGrid .aw-grid-row {padding-bottom: 3px;}
/* Alternate row colors */
#myGrid .aw-alternate-even {background: #fff;}
#myGrid .aw-alternate-odd {background: #eee;}
</style>
<script>
var myData = [
['MSFT','Microsoft Corporation', '314,571.156', '32,187.000', '55000'],
['ORCL', 'Oracle Corporation', '62,615.266', '9,519.000', '40650'],
['DOX', 'Amdocs Limited', '4,288.017', '1,427.088', '9400'],
['CTXS', 'Citrix Systems, Inc.', '3,946.485', '554.222', '1670'],
['KNM', 'Konami Corporation', '3,710.784', '.000', '4313']
];
var myHeaders = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
var obj = new AW.Grid.Extended;
obj.setId("myGrid");
obj.setCellEditable(true);
obj.setHeaderText(myHeaders);
obj.setCellText(myData);
obj.setColumnCount(5);
obj.setRowCount(5);
obj.setSelectorVisible(true);
obj.setSelectorWidth(55);
obj.setRowHeight(25);
var rc = 1; // put a text input field on the selector
for (var i=0; i< 5; i++)
{
textStr = "<input type=text size=2 id='ord" + i + "' value='" + rc*10 + "'>";
obj.setSelectorText(textStr, i);
rc++;
}
document.write(obj);
// set the color if edited
obj.onCellTextChanged = function() {
obj.getCellTemplate(this.getCurrentColumn(), this.getCurrentRow()).setStyle("color", "red");
};
</script>
</body>
</html>
any idea what i can do? i am using 2.5
mango
May 7,