public/javascripts/yui/datatable/datatable.js
function(o) {
    if(o && (o.ownerDocument == document)) {
        return (Dom.hasClass(this.getTdEl(o),DT.CLASS_SELECTED) || Dom.hasClass(this.getTrEl(o),DT.CLASS_SELECTED));
    }
    else {
        var oRecord, sRecordId, j;
        var tracker = this._aSelections;
        if(tracker && tracker.length > 0) {
            // Looking for a Record?
            if(o instanceof YAHOO.widget.Record) {
                oRecord = o;
            }
            else if(lang.isNumber(o)) {
                oRecord = this.getRecord(o);
            }
            if(oRecord) {
                sRecordId = oRecord.getId();

                // Is it there?
                // Use Array.indexOf if available...
                if(tracker.indexOf) {
                    if(tracker.indexOf(sRecordId) >  -1) {
                        return true;
                    }
                }
                // ...or do it the old-fashioned way
                else {
                    for(j=tracker.length-1; j>-1; j--) {
                       if(tracker[j] === sRecordId){
                        return true;
                       }
                    }
                }
            }
            // Looking for a cell
            else if(o.record && o.column){
                sRecordId = o.record.getId();
                var sColumnKey = o.column.getKey();

                for(j=tracker.length-1; j>-1; j--) {
                    if((tracker[j].recordId === sRecordId) && (tracker[j].columnKey === sColumnKey)){
                        return true;
                    }
                }
            }
        }
    }
    return false;
}
function(o) {
    if(o && (o.ownerDocument == document)) {
        return (Dom.hasClass(this.getTdEl(o),DT.CLASS_SELECTED) || Dom.hasClass(this.getTrEl(o),DT.CLASS_SELECTED));
    }
    else {
        var oRecord, sRecordId, j;
        var tracker = this._aSelections;
        if(tracker && tracker.length > 0) {
            // Looking for a Record?
            if(o instanceof YAHOO.widget.Record) {
                oRecord = o;
            }
            else if(lang.isNumber(o)) {
                oRecord = this.getRecord(o);
            }
            if(oRecord) {
                sRecordId = oRecord.getId();

                // Is it there?
                // Use Array.indexOf if available...
                if(tracker.indexOf) {
                    if(tracker.indexOf(sRecordId) >  -1) {
                        return true;
                    }
                }
                // ...or do it the old-fashioned way
                else {
                    for(j=tracker.length-1; j>-1; j--) {
                       if(tracker[j] === sRecordId){
                        return true;
                       }
                    }
                }
            }
            // Looking for a cell
            else if(o.record && o.column){
                sRecordId = o.record.getId();
                var sColumnKey = o.column.getKey();

                for(j=tracker.length-1; j>-1; j--) {
                    if((tracker[j].recordId === sRecordId) && (tracker[j].columnKey === sColumnKey)){
                        return true;
                    }
                }
            }
        }
    }
    return false;
}
function ( o ) { if ( o && ( o . ownerDocument == document ) ) { return ( Dom . hasClass ( this . getTdEl ( o ) , DT . CLASS_SELECTED ) || Dom . hasClass ( this . getTrEl ( o ) , DT . CLASS_SELECTED ) ) ; } else { var oRecord , sRecordId , j ; var tracker = this . _aSelections ; if ( tracker && tracker . length > 0 ) { // Looking for a Record? if ( o instanceof YAHOO . widget . Record ) { oRecord = o ; } else if ( lang . isNumber ( o ) ) { oRecord = this . getRecord ( o ) ; } if ( oRecord ) { sRecordId = oRecord . getId ( ) ; // Is it there? // Use Array.indexOf if available... if ( tracker . indexOf ) { if ( tracker . indexOf ( sRecordId ) > - 1 ) { return true ; } } // ...or do it the old-fashioned way else { for ( j = tracker . length - 1 ; j > - 1 ; j -- ) { if ( tracker [ j ] === sRecordId ) { return true ; } } } } // Looking for a cell else if ( o . record && o . column ) { sRecordId = o . record . getId ( ) ; var sColumnKey = o . column . getKey ( ) ; for ( j = tracker . length - 1 ; j > - 1 ; j -- ) { if ( ( tracker [ j ] . recordId === sRecordId ) && ( tracker [ j ] . columnKey === sColumnKey ) ) { return true ; } } } } } return false ; }
Returns true if given item is selected, false otherwise.

@method isSelected
@param o {String | HTMLElement | YAHOO.widget.Record | Number
{record:YAHOO.widget.Record, column:YAHOO.widget.Column} } TR or TD element by
reference or ID string, a Record instance, a RecordSet position index,
or an object literal representation
of a cell.
@return {Boolean} True if item is selected.
Returns true if given item is selected false otherwise .