public/javascripts/yui/datatable/datatable.js
function(record) {
        var i;
        if(record instanceof widget.Record) {
            for(i=0; i<this._records.length; i++) {
                if(this._records[i] && (this._records[i]._sId === record._sId)) {
                    return record;
                }
            }
        }
        else if(lang.isNumber(record)) {
            if((record > -1) && (record < this.getLength())) {
                return this._records[record];
            }
        }
        else if(lang.isString(record)) {
            for(i=0; i<this._records.length; i++) {
                if(this._records[i] && (this._records[i]._sId === record)) {
                    return this._records[i];
                }
            }
        }
        // Not a valid Record for this RecordSet
        return null;

    }
function(record) {
        var i;
        if(record instanceof widget.Record) {
            for(i=0; i<this._records.length; i++) {
                if(this._records[i] && (this._records[i]._sId === record._sId)) {
                    return record;
                }
            }
        }
        else if(lang.isNumber(record)) {
            if((record > -1) && (record < this.getLength())) {
                return this._records[record];
            }
        }
        else if(lang.isString(record)) {
            for(i=0; i<this._records.length; i++) {
                if(this._records[i] && (this._records[i]._sId === record)) {
                    return this._records[i];
                }
            }
        }
        // Not a valid Record for this RecordSet
        return null;

    }
function ( record ) { var i ; if ( record instanceof widget . Record ) { for ( i = 0 ; i < this . _records . length ; i ++ ) { if ( this . _records [ i ] && ( this . _records [ i ] . _sId === record . _sId ) ) { return record ; } } } else if ( lang . isNumber ( record ) ) { if ( ( record > - 1 ) && ( record < this . getLength ( ) ) ) { return this . _records [ record ] ; } } else if ( lang . isString ( record ) ) { for ( i = 0 ; i < this . _records . length ; i ++ ) { if ( this . _records [ i ] && ( this . _records [ i ] . _sId === record ) ) { return this . _records [ i ] ; } } } // Not a valid Record for this RecordSet return null ; }
Returns Record by ID or RecordSet position index.

@method getRecord
@param record {YAHOO.widget.Record | Number | String} Record instance,
RecordSet position index, or Record ID.
@return {YAHOO.widget.Record} Record object.
Returns Record by ID or RecordSet position index .