Combo in cell (possibly incorrect js code) crashes IE7
Hi Alex,
The version of IE7 I'm using is IE 7.0.5730.13 and AW 2.5.2
The code is given below.
It just embeds a combo on cell double click and puts the selected item text into the cell text.
When I double click on any cell using IE7, select a value from the dropdown and then click on another cell, the browser crashes (Internet Explorer has encountered a problem and needs to close ...)
I'm wondering if the problem line is obj.setCellTemplate(new AW.Templates.ImageText, col, row) ?
When I comment it out, the browser doesn't crash, but the combo doesn't disappear either.
Is there some other template I can set it to that won't crash the browser ?
Or is there something basic that I'm missing out ?
Also note that the code works fine in FF3 - that why I was using it till now.
Only when I recently tested it in IE7 did I notice the crash.
Thanks,
Ankur
The version of IE7 I'm using is IE 7.0.5730.13 and AW 2.5.2
The code is given below.
It just embeds a combo on cell double click and puts the selected item text into the cell text.
When I double click on any cell using IE7, select a value from the dropdown and then click on another cell, the browser crashes (Internet Explorer has encountered a problem and needs to close ...)
I'm wondering if the problem line is obj.setCellTemplate(new AW.Templates.ImageText, col, row) ?
When I comment it out, the browser doesn't crash, but the combo doesn't disappear either.
Is there some other template I can set it to that won't crash the browser ?
Or is there something basic that I'm missing out ?
Also note that the code works fine in FF3 - that why I was using it till now.
Only when I recently tested it in IE7 did I notice the crash.
var obj = new AW.Grid.Extended;
obj.setCellText(function(i, j){return j + "." + i});
obj.setHeaderText(["header1", "header2", "header3", "header4", "header5", "header6", "header7", "header8", "header9", "header10"], 0);
obj.setFixedLeft(0);
obj.setColumnCount(10);
obj.setRowCount(100);
obj.onCellDoubleClicked = function(event, col, row) {
var combo = new AW.UI.Combo;
var originalText = obj.getCellText(col, row);
obj.setCellTemplate(combo, col, row);
obj.getCellTemplate(col, row).setControlText(originalText);
obj.getCellTemplate(col, row).setItemText(["a", "b", "c", "d"]);
obj.getCellTemplate(col, row).setItemCount(4);
obj.getCellTemplate(col, row).getContent('box/text').setAttribute('readonly', true);
obj.getCellTemplate(col, row).onControlEditEnded = function(text) {
obj.setCellTemplate(new AW.Templates.ImageText, col, row);
obj.getRowTemplate(row).refresh();
obj.setCellText(text, col, row);
}
obj.getRowTemplate(row).refresh();
obj.getCellTemplate(col, row).getContent('box/text').element().focus();
}
document.write(obj);
Thanks,
Ankur
Ankur Motreja
August 6,