aria.Grid.prototype.checkFocusChange = function()

in Utils/azure-toolkit-ide-hdinsight-libs/hdinsight-node-common/resources/htmlResources/hdinsight/job/html/js/dataGrid.js [290:351]


 aria.Grid.prototype.checkFocusChange = function (event) {
   if (!event || this.navigationDisabled) {
     return;
   }
 
   this.findFocusedItem(event.target);
 
   var key = event.which || event.keyCode;
   var rowCaret = this.focusedRow;
   var colCaret = this.focusedCol;
   var nextCell;
 
   switch (key) {
     case aria.KeyCode.UP:
       nextCell = this.getNextVisibleCell(0, -1);
       rowCaret = nextCell.row;
       colCaret = nextCell.col;
       break;
     case aria.KeyCode.DOWN:
       nextCell = this.getNextVisibleCell(0, 1);
       rowCaret = nextCell.row;
       colCaret = nextCell.col;
       break;
     case aria.KeyCode.LEFT:
       nextCell = this.getNextVisibleCell(-1, 0);
       rowCaret = nextCell.row;
       colCaret = nextCell.col;
       break;
     case aria.KeyCode.RIGHT:
       nextCell = this.getNextVisibleCell(1, 0);
       rowCaret = nextCell.row;
       colCaret = nextCell.col;
       break;
     case aria.KeyCode.HOME:
       if (event.ctrlKey) {
         rowCaret = 0;
       }
       colCaret = 0;
       break;
     case aria.KeyCode.END:
       if (event.ctrlKey) {
         rowCaret = this.grid.length - 1;
       }
       colCaret = this.grid[this.focusedRow].length - 1;
       break;
     default:
       return;
   }
 
   if (this.paginationEnabled) {
     if (rowCaret < this.topIndex) {
       this.showFromRow(rowCaret, true);
     }
 
     if (rowCaret >= this.topIndex + this.perPage) {
       this.showFromRow(rowCaret, false);
     }
   }
 
   this.focusCell(rowCaret, colCaret);
   event.preventDefault();
 };