public/javascripts/yui/datatable/datatable.js
function(oData, index) {
    if(lang.isNumber(index) && (index < 0 || index > this._oRecordSet.getLength())) {
        return;
    }

    if(oData && lang.isObject(oData)) {
        var oRecord = this._oRecordSet.addRecord(oData, index);
        if(oRecord) {
            var recIndex;
            var oPaginator = this.get('paginator');

            // Paginated
            if (oPaginator) {     
                // Update the paginator's totalRecords
                var totalRecords = oPaginator.get('totalRecords');
                if (totalRecords !== widget.Paginator.VALUE_UNLIMITED) {
                    oPaginator.set('totalRecords',totalRecords + 1);
                }

                recIndex = this.getRecordIndex(oRecord);
                var endRecIndex = (oPaginator.getPageRecords())[1];

                // New record affects the view
                if (recIndex <= endRecIndex) {
                    // Defer UI updates to the render method
                    this.render();
                }
                
                this.fireEvent("rowAddEvent", {record:oRecord});
                return;
            }
            // Not paginated
            else {
                recIndex = this.getTrIndex(oRecord);
                if(lang.isNumber(recIndex)) {
                    // Add the TR element
                    this._oChainRender.add({
                        method: function(oArg) {
                            if((this instanceof DT) && this._sId) {
                                var oRecord = oArg.record;
                                var recIndex = oArg.recIndex;
                                var elNewTr = this._addTrEl(oRecord);
                                if(elNewTr) {
                                    var elNext = (this._elTbody.rows[recIndex]) ? this._elTbody.rows[recIndex] : null;
                                    this._elTbody.insertBefore(elNewTr, elNext);

                                    // Set FIRST/LAST
                                    if(recIndex === 0) {
                                        this._setFirstRow();
                                    }
                                    if(elNext === null) {
                                        this._setLastRow();
                                    }
                                    // Set EVEN/ODD
                                    this._setRowStripes();                           
                                    
                                    this.hideTableMessage();
            
                                    this.fireEvent("rowAddEvent", {record:oRecord});
                                }
                            }
                        },
                        argument: {record: oRecord, recIndex: recIndex},
                        scope: this,
                        timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
                    });
                    this._runRenderChain();
                    return;
                }
            }            
        }
    }
}
function(oData, index) {
    if(lang.isNumber(index) && (index < 0 || index > this._oRecordSet.getLength())) {
        return;
    }

    if(oData && lang.isObject(oData)) {
        var oRecord = this._oRecordSet.addRecord(oData, index);
        if(oRecord) {
            var recIndex;
            var oPaginator = this.get('paginator');

            // Paginated
            if (oPaginator) {     
                // Update the paginator's totalRecords
                var totalRecords = oPaginator.get('totalRecords');
                if (totalRecords !== widget.Paginator.VALUE_UNLIMITED) {
                    oPaginator.set('totalRecords',totalRecords + 1);
                }

                recIndex = this.getRecordIndex(oRecord);
                var endRecIndex = (oPaginator.getPageRecords())[1];

                // New record affects the view
                if (recIndex <= endRecIndex) {
                    // Defer UI updates to the render method
                    this.render();
                }
                
                this.fireEvent("rowAddEvent", {record:oRecord});
                return;
            }
            // Not paginated
            else {
                recIndex = this.getTrIndex(oRecord);
                if(lang.isNumber(recIndex)) {
                    // Add the TR element
                    this._oChainRender.add({
                        method: function(oArg) {
                            if((this instanceof DT) && this._sId) {
                                var oRecord = oArg.record;
                                var recIndex = oArg.recIndex;
                                var elNewTr = this._addTrEl(oRecord);
                                if(elNewTr) {
                                    var elNext = (this._elTbody.rows[recIndex]) ? this._elTbody.rows[recIndex] : null;
                                    this._elTbody.insertBefore(elNewTr, elNext);

                                    // Set FIRST/LAST
                                    if(recIndex === 0) {
                                        this._setFirstRow();
                                    }
                                    if(elNext === null) {
                                        this._setLastRow();
                                    }
                                    // Set EVEN/ODD
                                    this._setRowStripes();                           
                                    
                                    this.hideTableMessage();
            
                                    this.fireEvent("rowAddEvent", {record:oRecord});
                                }
                            }
                        },
                        argument: {record: oRecord, recIndex: recIndex},
                        scope: this,
                        timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
                    });
                    this._runRenderChain();
                    return;
                }
            }            
        }
    }
}
function ( oData , index ) { if ( lang . isNumber ( index ) && ( index < 0 || index > this . _oRecordSet . getLength ( ) ) ) { return ; } if ( oData && lang . isObject ( oData ) ) { var oRecord = this . _oRecordSet . addRecord ( oData , index ) ; if ( oRecord ) { var recIndex ; var oPaginator = this . get ( 'paginator' ) ; // Paginated if ( oPaginator ) { // Update the paginator's totalRecords var totalRecords = oPaginator . get ( 'totalRecords' ) ; if ( totalRecords !== widget . Paginator . VALUE_UNLIMITED ) { oPaginator . set ( 'totalRecords' , totalRecords + 1 ) ; } recIndex = this . getRecordIndex ( oRecord ) ; var endRecIndex = ( oPaginator . getPageRecords ( ) ) [ 1 ] ; // New record affects the view if ( recIndex <= endRecIndex ) { // Defer UI updates to the render method this . render ( ) ; } this . fireEvent ( "rowAddEvent" , { record : oRecord } ) ; return ; } // Not paginated else { recIndex = this . getTrIndex ( oRecord ) ; if ( lang . isNumber ( recIndex ) ) { // Add the TR element this . _oChainRender . add ( { method : function ( oArg ) { if ( ( this instanceof DT ) && this . _sId ) { var oRecord = oArg . record ; var recIndex = oArg . recIndex ; var elNewTr = this . _addTrEl ( oRecord ) ; if ( elNewTr ) { var elNext = ( this . _elTbody . rows [ recIndex ] ) ? this . _elTbody . rows [ recIndex ] : null ; this . _elTbody . insertBefore ( elNewTr , elNext ) ; // Set FIRST/LAST if ( recIndex === 0 ) { this . _setFirstRow ( ) ; } if ( elNext === null ) { this . _setLastRow ( ) ; } // Set EVEN/ODD this . _setRowStripes ( ) ; this . hideTableMessage ( ) ; this . fireEvent ( "rowAddEvent" , { record : oRecord } ) ; } } } , argument : { record : oRecord , recIndex : recIndex } , scope : this , timeout : ( this . get ( "renderLoopSize" ) > 0 ) ? 0 : - 1 } ) ; this . _runRenderChain ( ) ; return ; } } } } }
ROW FUNCTIONS 
Adds one new Record of data into the RecordSet at the index if given,
otherwise at the end. If the new Record is in page view, the
corresponding DOM elements are also updated.

@method addRow
@param oData {Object} Object literal of data for the row.
@param index {Number} (optional) RecordSet position index at which to add data.
ROW FUNCTIONS Adds one new Record of data into the RecordSet at the index if given otherwise at the end . If the new Record is in page view the corresponding DOM elements are also updated .