diff --git a/media/src/DataTables.js b/media/src/DataTables.js index f5de7dd7..dbb57da5 100644 --- a/media/src/DataTables.js +++ b/media/src/DataTables.js @@ -21,7 +21,7 @@ */ /*jslint evil: true, undef: true, browser: true */ -/*globals $,require,jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns,_fnHungarianMap,_fnCamelToHungarian,_fnBuildAjax,_fnAjaxDataSrc*/ +/*globals $,require,jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnEscapeRegex,_fnDeleteIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns,_fnHungarianMap,_fnCamelToHungarian,_fnBuildAjax,_fnAjaxDataSrc*/ (/** @lends */function( window, document, undefined ) { diff --git a/media/src/api/api.internal.js b/media/src/api/api.internal.js index 5201063d..8f57bb55 100644 --- a/media/src/api/api.internal.js +++ b/media/src/api/api.internal.js @@ -82,7 +82,6 @@ this.oApi = { "_fnSettingsFromNode": _fnSettingsFromNode, "_fnGetDataMaster": _fnGetDataMaster, "_fnGetTrNodes": _fnGetTrNodes, - "_fnGetTdNodes": _fnGetTdNodes, "_fnEscapeRegex": _fnEscapeRegex, "_fnDeleteIndex": _fnDeleteIndex, "_fnColumnOrdering": _fnColumnOrdering, diff --git a/media/src/core/core.data.js b/media/src/core/core.data.js index e0eaf086..d56abc9d 100644 --- a/media/src/core/core.data.js +++ b/media/src/core/core.data.js @@ -126,16 +126,7 @@ function _fnNodeToDataIndex( oSettings, n ) */ function _fnNodeToColumnIndex( oSettings, iRow, n ) { - var anCells = _fnGetTdNodes( oSettings, iRow ); - - for ( var i=0, iLen=oSettings.aoColumns.length ; i').html( _fnGetCellData( oSettings, iMaxIndex, iCol, 'display' ) )[0] : + data.anCells[ iCol ]; } +var __re_html_remove = /<.*?>/g; + /** * Get the maximum strlen for each data column * @param {object} oSettings dataTables settings object @@ -320,13 +319,13 @@ function _fnGetWidestNode( oSettings, iCol ) */ function _fnGetMaxLenString( oSettings, iCol ) { - var iMax = -1; - var iMaxIndex = -1; + var s, iMax=-1, iMaxIndex = -1; for ( var i=0 ; i/g, "" ); + s = _fnGetCellData( oSettings, i, iCol, 'display' )+''; + s = s.replace( __re_html_remove, '' ); + if ( s.length > iMax ) { iMax = s.length; diff --git a/media/src/core/core.sort.js b/media/src/core/core.sort.js index 61825926..d913723b 100644 --- a/media/src/core/core.sort.js +++ b/media/src/core/core.sort.js @@ -434,6 +434,13 @@ function _fnSortingClasses( oSettings ) $(oSettings.aoColumns[i].nTh).addClass( oSettings.aoColumns[i].sSortingClass ); } } + + // @todo This is totally inefficient. It is accessing the class name of every + // cell when it really doesn't need to. It should determine which cells + // have classes to be removed (by saving the previous state or doing a check + // on the first row), and then add to the required cells. Use _pluck. + // DISABLED until this can be done, since _fnGetTdNodes has been removed. + return; /* * Apply the required classes to the table body diff --git a/media/src/core/core.support.js b/media/src/core/core.support.js index cdcb7d26..fa707944 100644 --- a/media/src/core/core.support.js +++ b/media/src/core/core.support.js @@ -40,67 +40,6 @@ function _fnGetTrNodes ( oSettings ) } -/** - * Return an flat array with all TD nodes for the table, or row - * @param {object} oSettings dataTables settings object - * @param {int} [iIndividualRow] aoData index to get the nodes for - optional - * if not given then the return array will contain all nodes for the table - * @returns {array} TD array - * @memberof DataTable#oApi - */ -function _fnGetTdNodes ( oSettings, iIndividualRow ) -{ - var anReturn = []; - var iCorrector; - var anTds, nTd; - var iRow, iRows=oSettings.aoData.length, - iColumn, iColumns, oData, sNodeName, iStart=0, iEnd=iRows; - - /* Allow the collection to be limited to just one row */ - if ( iIndividualRow !== undefined ) - { - iStart = iIndividualRow; - iEnd = iIndividualRow+1; - } - - for ( iRow=iStart ; iRow