MCPcopy Create free account
hub / github.com/blockstrap/framework / _fnAddData

Function _fnAddData

blockstrap/js/dependencies/tables.js:944–979  ·  view source on GitHub ↗

* Add a data array to the table, creating DOM node etc. This is the parallel to * _fnGatherData, but for adding rows from a Javascript source, rather than a * DOM source. * @param {object} oSettings dataTables settings object * @param {array} aData data array to be added * @param {node}

( oSettings, aDataIn, nTr, anTds )

Source from the content-addressed store, hash-verified

942 * @memberof DataTable#oApi
943 */
944 function _fnAddData ( oSettings, aDataIn, nTr, anTds )
945 {
946 /* Create the object for storing information about this new row */
947 var iRow = oSettings.aoData.length;
948 var oData = $.extend( true, {}, DataTable.models.oRow, {
949 src: nTr ? 'dom' : 'data'
950 } );
951
952 oData._aData = aDataIn;
953 oSettings.aoData.push( oData );
954
955 /* Create the cells */
956 var nTd, sThisType;
957 var columns = oSettings.aoColumns;
958 for ( var i=0, iLen=columns.length ; i<iLen ; i++ )
959 {
960 // When working with a row, the data source object must be populated. In
961 // all other cases, the data source object is already populated, so we
962 // don't overwrite it, which might break bindings etc
963 if ( nTr ) {
964 _fnSetCellData( oSettings, iRow, i, _fnGetCellData( oSettings, iRow, i ) );
965 }
966 columns[i].sType = null;
967 }
968
969 /* Add to the display array */
970 oSettings.aiDisplayMaster.push( iRow );
971
972 /* Create the DOM information */
973 if ( !oSettings.oFeatures.bDeferRender )
974 {
975 _fnCreateTr( oSettings, iRow, nTr, anTds );
976 }
977
978 return iRow;
979 }
980
981
982 /**

Callers 5

_fnAddTrFunction · 0.85
_fnAjaxUpdateDrawFunction · 0.85
_fnInitialiseFunction · 0.85
tables.jsFile · 0.85
__reloadFunction · 0.85

Calls 3

_fnSetCellDataFunction · 0.85
_fnGetCellDataFunction · 0.85
_fnCreateTrFunction · 0.85

Tested by

no test coverage detected