3.2.0

onKeyTab kill event

Hi,
I tried to override the tab key functionality. Everything works fine when you have an editable cell. However if the cell is not editable the cell does not get focus and the tab takes the focus out. Behaves differently in Firefox and IE.

<script>

    var myCells = [
        ["Cell text", "123", "5/18/2004"],
        ["More...", "456", "1/12/2006"],["Cell text", "123", "5/18/2004"],
        ["More...", "456", "1/12/2006"],["Cell text", "123", "5/18/2004"],
        ["More...", "456", "1/12/2006"]
    ]

    var obj = new AW.UI.Grid;
    obj.setCellText(myCells); 
    obj.setCellEditable(false); // all cells not editable
    obj.setColumnCount(3);
    obj.setRowCount(6);
obj.setController("myTabKeys", {
        onKeyTab: "justalert",
        onKeyShiftTab: "selectPreviousCell"
    }); 
    document.write(obj);
obj.justalert=function(){
var col = this.getSelectedColumns()[0];
var row = this.getSelectedRows()[0];
alert('called');
this.setSelectedRows([row]);
this.setSelectedColumns([col ]);
this.setCurrentRow(row);
this.setCurrentColumn(col );
}
</script>
Sandip
May 28,
Help even killing the event using
e.cancelBubble = true;
    if (e.stopPropagation) e.stopPropagation();


does not help. The grid is not capturing the event. If i make the cell editable it works, but i dont want to do that.
Sandip
May 30,

This topic is archived.

See also:


Back to support forum