Ok I am really confused. Right now I am working on getting a datagrid to focus on a cell by selecting a point on a map. Below is the javascript that controls the election. I added cell.elements.focus() and it DOES focus on the cell I want it to but it also gives me an error at the same time saying “Microsoft JScript runtime error: ‘element’ is null or not an object” Any idea why it would give me an error but still work? Is there a way I can get rid of this error?
function selectRowByID(sIDField, sID) {
var bSelectionFound = false;
var grid = igtbl_getGridById(_gridID);
if (grid != null) {
var rows = grid.Rows;
for (var x = 0; x < rows.length; x++) {
var row = rows.getRow(x);
var cell = row.getCellFromKey(sIDField);
if (cell != null) {
cell.scrollToView(true);
if (cell.getValue() == sID) {
row.setSelected(true);
cell.element.focus();
bSelectionFound = true;
}
}
}
}
return bSelectionFound;
The error says ‘element’ is not set. Try skipping the .element in this sentence
so it becomes