/* * Function: _fnAddData * Purpose: Add a data array to the table, creating DOM node etc * Returns: int: - >=0 if successful (index of new aoData entry), -1 if failed * Inputs: object:oSettings - dataTables settings object * array:aData - data array to be added * Notes: There are two basic methods for DataTables to get data to display - a JS array * (which is dealt with by this function), and the DOM, which has it's own optimised * function (_fnGatherData). Be careful to make the same changes here as there and vice-versa */ function _fnAddData ( oSettings, aDataSupplied ) { var oCol; /* Take an independent copy of the data source so we can bash it about as we wish */ var aDataIn = ($.isArray(aDataSupplied)) ? aDataSupplied.slice() : $.extend( true, {}, aDataSupplied ); /* Create the object for storing information about this new row */ var iRow = oSettings.aoData.length; var oData = { "nTr": null, "_iId": oSettings.iNextId++, "_aData": aDataIn, "_aSortData": [], "_anHidden": [], "_sRowStripe": "" }; oSettings.aoData.push( oData ); /* Create the cells */ var nTd, sThisType; for ( var i=0, iLen=oSettings.aoColumns.length ; i