public/javascripts/yui/datatable/datatable.js
function(e) {
    var nKey = Ev.getCharCode(e);

    if((nKey == 38) || (nKey == 40)) {
        var bSHIFT = e.shiftKey;

        // Validate trigger
        var oTrigger = this._getSelectionTrigger();
        // Arrow selection only works if last selected row is on current page
        if(!oTrigger) {
            return null;
        }

        Ev.stopEvent(e);

        // Validate anchor
        var oAnchor = this._getSelectionAnchor(oTrigger);

        // Determine which direction we're going to
        if(bSHIFT) {
            // Selecting down away from anchor row
            if((nKey == 40) && (oAnchor.recordIndex <= oTrigger.trIndex)) {
                this.selectRow(this.getNextTrEl(oTrigger.el));
            }
            // Selecting up away from anchor row
            else if((nKey == 38) && (oAnchor.recordIndex >= oTrigger.trIndex)) {
                this.selectRow(this.getPreviousTrEl(oTrigger.el));
            }
            // Unselect trigger
            else {
                this.unselectRow(oTrigger.el);
            }
        }
        else {
            this._handleSingleSelectionByKey(e);
        }
    }
}
function(e) {
    var nKey = Ev.getCharCode(e);

    if((nKey == 38) || (nKey == 40)) {
        var bSHIFT = e.shiftKey;

        // Validate trigger
        var oTrigger = this._getSelectionTrigger();
        // Arrow selection only works if last selected row is on current page
        if(!oTrigger) {
            return null;
        }

        Ev.stopEvent(e);

        // Validate anchor
        var oAnchor = this._getSelectionAnchor(oTrigger);

        // Determine which direction we're going to
        if(bSHIFT) {
            // Selecting down away from anchor row
            if((nKey == 40) && (oAnchor.recordIndex <= oTrigger.trIndex)) {
                this.selectRow(this.getNextTrEl(oTrigger.el));
            }
            // Selecting up away from anchor row
            else if((nKey == 38) && (oAnchor.recordIndex >= oTrigger.trIndex)) {
                this.selectRow(this.getPreviousTrEl(oTrigger.el));
            }
            // Unselect trigger
            else {
                this.unselectRow(oTrigger.el);
            }
        }
        else {
            this._handleSingleSelectionByKey(e);
        }
    }
}
function ( e ) { var nKey = Ev . getCharCode ( e ) ; if ( ( nKey == 38 ) || ( nKey == 40 ) ) { var bSHIFT = e . shiftKey ; // Validate trigger var oTrigger = this . _getSelectionTrigger ( ) ; // Arrow selection only works if last selected row is on current page if ( ! oTrigger ) { return null ; } Ev . stopEvent ( e ) ; // Validate anchor var oAnchor = this . _getSelectionAnchor ( oTrigger ) ; // Determine which direction we're going to if ( bSHIFT ) { // Selecting down away from anchor row if ( ( nKey == 40 ) && ( oAnchor . recordIndex <= oTrigger . trIndex ) ) { this . selectRow ( this . getNextTrEl ( oTrigger . el ) ) ; } // Selecting up away from anchor row else if ( ( nKey == 38 ) && ( oAnchor . recordIndex >= oTrigger . trIndex ) ) { this . selectRow ( this . getPreviousTrEl ( oTrigger . el ) ) ; } // Unselect trigger else { this . unselectRow ( oTrigger . el ) ; } } else { this . _handleSingleSelectionByKey ( e ) ; } } }
Determines selection behavior resulting from a key event when selection mode
is set to "standard".

@method _handleStandardSelectionByKey
@param e {HTMLEvent} Event object.
@private
Determines selection behavior resulting from a key event when selection mode is set to standard .