:: Forum >> Version 2 >>

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
Monday, May 28, 2007
Help even killing the event using e.cancelBubble true;
    if (
e.stopPropagatione.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
Wednesday, May 30, 2007



This topic is archived.

Back to support forum

Forum search