public/javascripts/yui/datatable/datatable.js
function(aData, index) {
        if(lang.isArray(aData)) {
            var newRecords = [],
                idx,i,len;

            index = lang.isNumber(index) ? index : this._records.length;
            idx = index;

            // Can't go backwards bc we need to preserve order
            for(i=0,len=aData.length; i<len; ++i) {
                if(lang.isObject(aData[i])) {
                    var record = this._addRecord(aData[i], idx++);
                    newRecords.push(record);
                }
           }
            this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});
           return newRecords;
        }
        else if(lang.isObject(aData)) {
            var oRecord = this._addRecord(aData);
            this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});
            return oRecord;
        }
        else {
            return null;
        }
    }
function(aData, index) {
        if(lang.isArray(aData)) {
            var newRecords = [],
                idx,i,len;

            index = lang.isNumber(index) ? index : this._records.length;
            idx = index;

            // Can't go backwards bc we need to preserve order
            for(i=0,len=aData.length; i<len; ++i) {
                if(lang.isObject(aData[i])) {
                    var record = this._addRecord(aData[i], idx++);
                    newRecords.push(record);
                }
           }
            this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});
           return newRecords;
        }
        else if(lang.isObject(aData)) {
            var oRecord = this._addRecord(aData);
            this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});
            return oRecord;
        }
        else {
            return null;
        }
    }
function ( aData , index ) { if ( lang . isArray ( aData ) ) { var newRecords = [ ] , idx , i , len ; index = lang . isNumber ( index ) ? index : this . _records . length ; idx = index ; // Can't go backwards bc we need to preserve order for ( i = 0 , len = aData . length ; i < len ; ++ i ) { if ( lang . isObject ( aData [ i ] ) ) { var record = this . _addRecord ( aData [ i ] , idx ++ ) ; newRecords . push ( record ) ; } } this . fireEvent ( "recordsAddEvent" , { records : newRecords , data : aData } ) ; return newRecords ; } else if ( lang . isObject ( aData ) ) { var oRecord = this . _addRecord ( aData ) ; this . fireEvent ( "recordsAddEvent" , { records : [ oRecord ] , data : aData } ) ; return oRecord ; } else { return null ; } }
Adds multiple Records at once to the RecordSet at the given index with the
given object literal data. If index is null, then the new Records are
added to the end of the RecordSet.

@method addRecords
@param aData {Object[]} An object literal data or an array of data object literals.
@param index {Number} (optional) Position index.
@return {YAHOO.widget.Record[]} An array of Record instances.
Adds multiple Records at once to the RecordSet at the given index with the given object literal data . If index is null then the new Records are added to the end of the RecordSet .