{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\n", "Install the spreadsheet gem version ~>1.1.1 for using spreadsheet functions.\n", "\n", "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, { "data": { "text/plain": [ "true" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "require 'datatables'\n", "require 'daru'" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ " Daru::DataFrame(5x3) \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", "\n", "
abc
one11111
two21222
three31333
four41444
five51555
" ], "text/plain": [ "#\n", " a b c\n", " one 1 11 11\n", " two 2 12 22\n", " three 3 13 33\n", " four 4 14 44\n", " five 5 15 55" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = Daru::DataFrame.new({b: [11,12,13,14,15], a: [1,2,3,4,5],\n", " c: [11,22,33,44,55]},\n", " order: [:a, :b, :c],\n", " index: [:one, :two, :three, :four, :five])" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "data": { "application/javascript": [ "\n", " /* BEGIN jquery.dataTables.js */\n", "\n", "/*! DataTables 1.10.16-dev\n", " * ©2008-2017 SpryMedia Ltd - datatables.net/license\n", " */\n", "\n", "/**\n", " * @summary DataTables\n", " * @description Paginate, search and order HTML tables\n", " * @version 1.10.16-dev\n", " * @file jquery.dataTables.js\n", " * @author SpryMedia Ltd\n", " * @contact www.datatables.net\n", " * @copyright Copyright 2008-2017 SpryMedia Ltd.\n", " *\n", " * This source file is free software, available under the following license:\n", " * MIT license - http://datatables.net/license\n", " *\n", " * This source file is distributed in the hope that it will be useful, but\n", " * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n", " * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.\n", " *\n", " * For details please refer to: http://www.datatables.net\n", " */\n", "\n", "/*jslint evil: true, undef: true, browser: true */\n", "/*globals $,require,jQuery,define,_selector_run,_selector_opts,_selector_first,_selector_row_indexes,_ext,_Api,_api_register,_api_registerPlural,_re_new_lines,_re_html,_re_formatted_numeric,_re_escape_regex,_empty,_intVal,_numToDecimal,_isNumber,_isHtml,_htmlNumeric,_pluck,_pluck_order,_range,_stripHtml,_unique,_fnBuildAjax,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnAjaxDataSrc,_fnAddColumn,_fnColumnOptions,_fnAdjustColumnSizing,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnVisbleColumns,_fnGetColumns,_fnColumnTypes,_fnApplyColumnDefs,_fnHungarianMap,_fnCamelToHungarian,_fnLanguageCompat,_fnBrowserDetect,_fnAddData,_fnAddTr,_fnNodeToDataIndex,_fnNodeToColumnIndex,_fnGetCellData,_fnSetCellData,_fnSplitObjNotation,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnGetDataMaster,_fnClearTable,_fnDeleteIndex,_fnInvalidate,_fnGetRowElements,_fnCreateTr,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAddOptionsHtml,_fnDetectHeader,_fnGetUniqueThs,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnFilterCreateSearch,_fnEscapeRegex,_fnFilterData,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnInfoMacros,_fnInitialise,_fnInitComplete,_fnLengthChange,_fnFeatureHtmlLength,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnFeatureHtmlTable,_fnScrollDraw,_fnApplyToChildren,_fnCalculateColumnWidths,_fnThrottle,_fnConvertToWidth,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnSortFlatten,_fnSort,_fnSortAria,_fnSortListener,_fnSortAttachListener,_fnSortingClasses,_fnSortData,_fnSaveState,_fnLoadState,_fnSettingsFromNode,_fnLog,_fnMap,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnLengthOverflow,_fnRenderer,_fnDataSource,_fnRowAttributes*/\n", "\n", "(function( factory ) {\n", "\t\"use strict\";\n", "\n", "\tif ( typeof define === 'function' && define.amd ) {\n", "\t\t// AMD\n", "\t\tdefine( ['jquery'], function ( $ ) {\n", "\t\t\treturn factory( $, window, document );\n", "\t\t} );\n", "\t}\n", "\telse if ( typeof exports === 'object' ) {\n", "\t\t// CommonJS\n", "\t\tmodule.exports = function (root, $) {\n", "\t\t\tif ( ! root ) {\n", "\t\t\t\t// CommonJS environments without a window global must pass a\n", "\t\t\t\t// root. This will give an error otherwise\n", "\t\t\t\troot = window;\n", "\t\t\t}\n", "\n", "\t\t\tif ( ! $ ) {\n", "\t\t\t\t$ = typeof window !== 'undefined' ? // jQuery's factory checks for a global window\n", "\t\t\t\t\trequire('jquery') :\n", "\t\t\t\t\trequire('jquery')( root );\n", "\t\t\t}\n", "\n", "\t\t\treturn factory( $, root, root.document );\n", "\t\t};\n", "\t}\n", "\telse {\n", "\t\t// Browser\n", "\t\tfactory( jQuery, window, document );\n", "\t}\n", "}\n", "(function( $, window, document, undefined ) {\n", "\t\"use strict\";\n", "\n", "\t/**\n", "\t * DataTables is a plug-in for the jQuery Javascript library. It is a highly\n", "\t * flexible tool, based upon the foundations of progressive enhancement,\n", "\t * which will add advanced interaction controls to any HTML table. For a\n", "\t * full list of features please refer to\n", "\t * [DataTables.net](href=\"http://datatables.net).\n", "\t *\n", "\t * Note that the `DataTable` object is not a global variable but is aliased\n", "\t * to `jQuery.fn.DataTable` and `jQuery.fn.dataTable` through which it may\n", "\t * be accessed.\n", "\t *\n", "\t * @class\n", "\t * @param {object} [init={}] Configuration object for DataTables. Options\n", "\t * are defined by {@link DataTable.defaults}\n", "\t * @requires jQuery 1.7+\n", "\t *\n", "\t * @example\n", "\t * // Basic initialisation\n", "\t * $(document).ready( function {\n", "\t * $('#example').dataTable();\n", "\t * } );\n", "\t *\n", "\t * @example\n", "\t * // Initialisation with configuration options - in this case, disable\n", "\t * // pagination and sorting.\n", "\t * $(document).ready( function {\n", "\t * $('#example').dataTable( {\n", "\t * \"paginate\": false,\n", "\t * \"sort\": false\n", "\t * } );\n", "\t * } );\n", "\t */\n", "\tvar DataTable = function ( options )\n", "\t{\n", "\t\t/**\n", "\t\t * Perform a jQuery selector action on the table's TR elements (from the tbody) and\n", "\t\t * return the resulting jQuery object.\n", "\t\t * @param {string|node|jQuery} sSelector jQuery selector or node collection to act on\n", "\t\t * @param {object} [oOpts] Optional parameters for modifying the rows to be included\n", "\t\t * @param {string} [oOpts.filter=none] Select TR elements that meet the current filter\n", "\t\t * criterion (\"applied\") or all TR elements (i.e. no filter).\n", "\t\t * @param {string} [oOpts.order=current] Order of the TR elements in the processed array.\n", "\t\t * Can be either 'current', whereby the current sorting of the table is used, or\n", "\t\t * 'original' whereby the original order the data was read into the table is used.\n", "\t\t * @param {string} [oOpts.page=all] Limit the selection to the currently displayed page\n", "\t\t * (\"current\") or not (\"all\"). If 'current' is given, then order is assumed to be\n", "\t\t * 'current' and filter is 'applied', regardless of what they might be given as.\n", "\t\t * @returns {object} jQuery object, filtered by the given selector.\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Highlight every second row\n", "\t\t * oTable.$('tr:odd').css('backgroundColor', 'blue');\n", "\t\t * } );\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Filter to rows with 'Webkit' in them, add a background colour and then\n", "\t\t * // remove the filter, thus highlighting the 'Webkit' rows only.\n", "\t\t * oTable.fnFilter('Webkit');\n", "\t\t * oTable.$('tr', {\"search\": \"applied\"}).css('backgroundColor', 'blue');\n", "\t\t * oTable.fnFilter('');\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.$ = function ( sSelector, oOpts )\n", "\t\t{\n", "\t\t\treturn this.api(true).$( sSelector, oOpts );\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Almost identical to $ in operation, but in this case returns the data for the matched\n", "\t\t * rows - as such, the jQuery selector used should match TR row nodes or TD/TH cell nodes\n", "\t\t * rather than any descendants, so the data can be obtained for the row/cell. If matching\n", "\t\t * rows are found, the data returned is the original data array/object that was used to\n", "\t\t * create the row (or a generated array if from a DOM source).\n", "\t\t *\n", "\t\t * This method is often useful in-combination with $ where both functions are given the\n", "\t\t * same parameters and the array indexes will match identically.\n", "\t\t * @param {string|node|jQuery} sSelector jQuery selector or node collection to act on\n", "\t\t * @param {object} [oOpts] Optional parameters for modifying the rows to be included\n", "\t\t * @param {string} [oOpts.filter=none] Select elements that meet the current filter\n", "\t\t * criterion (\"applied\") or all elements (i.e. no filter).\n", "\t\t * @param {string} [oOpts.order=current] Order of the data in the processed array.\n", "\t\t * Can be either 'current', whereby the current sorting of the table is used, or\n", "\t\t * 'original' whereby the original order the data was read into the table is used.\n", "\t\t * @param {string} [oOpts.page=all] Limit the selection to the currently displayed page\n", "\t\t * (\"current\") or not (\"all\"). If 'current' is given, then order is assumed to be\n", "\t\t * 'current' and filter is 'applied', regardless of what they might be given as.\n", "\t\t * @returns {array} Data for the matched elements. If any elements, as a result of the\n", "\t\t * selector, were not TR, TD or TH elements in the DataTable, they will have a null\n", "\t\t * entry in the array.\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Get the data from the first row in the table\n", "\t\t * var data = oTable._('tr:first');\n", "\t\t *\n", "\t\t * // Do something useful with the data\n", "\t\t * alert( \"First cell is: \"+data[0] );\n", "\t\t * } );\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Filter to 'Webkit' and get all data for\n", "\t\t * oTable.fnFilter('Webkit');\n", "\t\t * var data = oTable._('tr', {\"search\": \"applied\"});\n", "\t\t *\n", "\t\t * // Do something with the data\n", "\t\t * alert( data.length+\" rows matched the search\" );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis._ = function ( sSelector, oOpts )\n", "\t\t{\n", "\t\t\treturn this.api(true).rows( sSelector, oOpts ).data();\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Create a DataTables Api instance, with the currently selected tables for\n", "\t\t * the Api's context.\n", "\t\t * @param {boolean} [traditional=false] Set the API instance's context to be\n", "\t\t * only the table referred to by the `DataTable.ext.iApiIndex` option, as was\n", "\t\t * used in the API presented by DataTables 1.9- (i.e. the traditional mode),\n", "\t\t * or if all tables captured in the jQuery object should be used.\n", "\t\t * @return {DataTables.Api}\n", "\t\t */\n", "\t\tthis.api = function ( traditional )\n", "\t\t{\n", "\t\t\treturn traditional ?\n", "\t\t\t\tnew _Api(\n", "\t\t\t\t\t_fnSettingsFromNode( this[ _ext.iApiIndex ] )\n", "\t\t\t\t) :\n", "\t\t\t\tnew _Api( this );\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Add a single new row or multiple rows of data to the table. Please note\n", "\t\t * that this is suitable for client-side processing only - if you are using\n", "\t\t * server-side processing (i.e. \"bServerSide\": true), then to add data, you\n", "\t\t * must add it to the data source, i.e. the server-side, through an Ajax call.\n", "\t\t * @param {array|object} data The data to be added to the table. This can be:\n", "\t\t * \n", "\t\t * @param {bool} [redraw=true] redraw the table or not\n", "\t\t * @returns {array} An array of integers, representing the list of indexes in\n", "\t\t * aoData ({@link DataTable.models.oSettings}) that have been added to\n", "\t\t * the table.\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * // Global var for counter\n", "\t\t * var giCount = 2;\n", "\t\t *\n", "\t\t * $(document).ready(function() {\n", "\t\t * $('#example').dataTable();\n", "\t\t * } );\n", "\t\t *\n", "\t\t * function fnClickAddRow() {\n", "\t\t * $('#example').dataTable().fnAddData( [\n", "\t\t * giCount+\".1\",\n", "\t\t * giCount+\".2\",\n", "\t\t * giCount+\".3\",\n", "\t\t * giCount+\".4\" ]\n", "\t\t * );\n", "\t\t *\n", "\t\t * giCount++;\n", "\t\t * }\n", "\t\t */\n", "\t\tthis.fnAddData = function( data, redraw )\n", "\t\t{\n", "\t\t\tvar api = this.api( true );\n", "\t\t\n", "\t\t\t/* Check if we want to add multiple rows or not */\n", "\t\t\tvar rows = $.isArray(data) && ( $.isArray(data[0]) || $.isPlainObject(data[0]) ) ?\n", "\t\t\t\tapi.rows.add( data ) :\n", "\t\t\t\tapi.row.add( data );\n", "\t\t\n", "\t\t\tif ( redraw === undefined || redraw ) {\n", "\t\t\t\tapi.draw();\n", "\t\t\t}\n", "\t\t\n", "\t\t\treturn rows.flatten().toArray();\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * This function will make DataTables recalculate the column sizes, based on the data\n", "\t\t * contained in the table and the sizes applied to the columns (in the DOM, CSS or\n", "\t\t * through the sWidth parameter). This can be useful when the width of the table's\n", "\t\t * parent element changes (for example a window resize).\n", "\t\t * @param {boolean} [bRedraw=true] Redraw the table or not, you will typically want to\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable( {\n", "\t\t * \"sScrollY\": \"200px\",\n", "\t\t * \"bPaginate\": false\n", "\t\t * } );\n", "\t\t *\n", "\t\t * $(window).on('resize', function () {\n", "\t\t * oTable.fnAdjustColumnSizing();\n", "\t\t * } );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnAdjustColumnSizing = function ( bRedraw )\n", "\t\t{\n", "\t\t\tvar api = this.api( true ).columns.adjust();\n", "\t\t\tvar settings = api.settings()[0];\n", "\t\t\tvar scroll = settings.oScroll;\n", "\t\t\n", "\t\t\tif ( bRedraw === undefined || bRedraw ) {\n", "\t\t\t\tapi.draw( false );\n", "\t\t\t}\n", "\t\t\telse if ( scroll.sX !== \"\" || scroll.sY !== \"\" ) {\n", "\t\t\t\t/* If not redrawing, but scrolling, we want to apply the new column sizes anyway */\n", "\t\t\t\t_fnScrollDraw( settings );\n", "\t\t\t}\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Quickly and simply clear a table\n", "\t\t * @param {bool} [bRedraw=true] redraw the table or not\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Immediately 'nuke' the current rows (perhaps waiting for an Ajax callback...)\n", "\t\t * oTable.fnClearTable();\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnClearTable = function( bRedraw )\n", "\t\t{\n", "\t\t\tvar api = this.api( true ).clear();\n", "\t\t\n", "\t\t\tif ( bRedraw === undefined || bRedraw ) {\n", "\t\t\t\tapi.draw();\n", "\t\t\t}\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * The exact opposite of 'opening' a row, this function will close any rows which\n", "\t\t * are currently 'open'.\n", "\t\t * @param {node} nTr the table row to 'close'\n", "\t\t * @returns {int} 0 on success, or 1 if failed (can't find the row)\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable;\n", "\t\t *\n", "\t\t * // 'open' an information row when a row is clicked on\n", "\t\t * $('#example tbody tr').click( function () {\n", "\t\t * if ( oTable.fnIsOpen(this) ) {\n", "\t\t * oTable.fnClose( this );\n", "\t\t * } else {\n", "\t\t * oTable.fnOpen( this, \"Temporary row opened\", \"info_row\" );\n", "\t\t * }\n", "\t\t * } );\n", "\t\t *\n", "\t\t * oTable = $('#example').dataTable();\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnClose = function( nTr )\n", "\t\t{\n", "\t\t\tthis.api( true ).row( nTr ).child.hide();\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Remove a row for the table\n", "\t\t * @param {mixed} target The index of the row from aoData to be deleted, or\n", "\t\t * the TR element you want to delete\n", "\t\t * @param {function|null} [callBack] Callback function\n", "\t\t * @param {bool} [redraw=true] Redraw the table or not\n", "\t\t * @returns {array} The row that was deleted\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Immediately remove the first row\n", "\t\t * oTable.fnDeleteRow( 0 );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnDeleteRow = function( target, callback, redraw )\n", "\t\t{\n", "\t\t\tvar api = this.api( true );\n", "\t\t\tvar rows = api.rows( target );\n", "\t\t\tvar settings = rows.settings()[0];\n", "\t\t\tvar data = settings.aoData[ rows[0][0] ];\n", "\t\t\n", "\t\t\trows.remove();\n", "\t\t\n", "\t\t\tif ( callback ) {\n", "\t\t\t\tcallback.call( this, settings, data );\n", "\t\t\t}\n", "\t\t\n", "\t\t\tif ( redraw === undefined || redraw ) {\n", "\t\t\t\tapi.draw();\n", "\t\t\t}\n", "\t\t\n", "\t\t\treturn data;\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Restore the table to it's original state in the DOM by removing all of DataTables\n", "\t\t * enhancements, alterations to the DOM structure of the table and event listeners.\n", "\t\t * @param {boolean} [remove=false] Completely remove the table from the DOM\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * // This example is fairly pointless in reality, but shows how fnDestroy can be used\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t * oTable.fnDestroy();\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnDestroy = function ( remove )\n", "\t\t{\n", "\t\t\tthis.api( true ).destroy( remove );\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Redraw the table\n", "\t\t * @param {bool} [complete=true] Re-filter and resort (if enabled) the table before the draw.\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Re-draw the table - you wouldn't want to do it here, but it's an example :-)\n", "\t\t * oTable.fnDraw();\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnDraw = function( complete )\n", "\t\t{\n", "\t\t\t// Note that this isn't an exact match to the old call to _fnDraw - it takes\n", "\t\t\t// into account the new data, but can hold position.\n", "\t\t\tthis.api( true ).draw( complete );\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Filter the input based on data\n", "\t\t * @param {string} sInput String to filter the table on\n", "\t\t * @param {int|null} [iColumn] Column to limit filtering to\n", "\t\t * @param {bool} [bRegex=false] Treat as regular expression or not\n", "\t\t * @param {bool} [bSmart=true] Perform smart filtering or not\n", "\t\t * @param {bool} [bShowGlobal=true] Show the input global filter in it's input box(es)\n", "\t\t * @param {bool} [bCaseInsensitive=true] Do case-insensitive matching (true) or not (false)\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Sometime later - filter...\n", "\t\t * oTable.fnFilter( 'test string' );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseInsensitive )\n", "\t\t{\n", "\t\t\tvar api = this.api( true );\n", "\t\t\n", "\t\t\tif ( iColumn === null || iColumn === undefined ) {\n", "\t\t\t\tapi.search( sInput, bRegex, bSmart, bCaseInsensitive );\n", "\t\t\t}\n", "\t\t\telse {\n", "\t\t\t\tapi.column( iColumn ).search( sInput, bRegex, bSmart, bCaseInsensitive );\n", "\t\t\t}\n", "\t\t\n", "\t\t\tapi.draw();\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Get the data for the whole table, an individual row or an individual cell based on the\n", "\t\t * provided parameters.\n", "\t\t * @param {int|node} [src] A TR row node, TD/TH cell node or an integer. If given as\n", "\t\t * a TR node then the data source for the whole row will be returned. If given as a\n", "\t\t * TD/TH cell node then iCol will be automatically calculated and the data for the\n", "\t\t * cell returned. If given as an integer, then this is treated as the aoData internal\n", "\t\t * data index for the row (see fnGetPosition) and the data for that row used.\n", "\t\t * @param {int} [col] Optional column index that you want the data of.\n", "\t\t * @returns {array|object|string} If mRow is undefined, then the data for all rows is\n", "\t\t * returned. If mRow is defined, just data for that row, and is iCol is\n", "\t\t * defined, only data for the designated cell is returned.\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * // Row data\n", "\t\t * $(document).ready(function() {\n", "\t\t * oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * oTable.$('tr').click( function () {\n", "\t\t * var data = oTable.fnGetData( this );\n", "\t\t * // ... do something with the array / object of data for the row\n", "\t\t * } );\n", "\t\t * } );\n", "\t\t *\n", "\t\t * @example\n", "\t\t * // Individual cell data\n", "\t\t * $(document).ready(function() {\n", "\t\t * oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * oTable.$('td').click( function () {\n", "\t\t * var sData = oTable.fnGetData( this );\n", "\t\t * alert( 'The cell clicked on had the value of '+sData );\n", "\t\t * } );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnGetData = function( src, col )\n", "\t\t{\n", "\t\t\tvar api = this.api( true );\n", "\t\t\n", "\t\t\tif ( src !== undefined ) {\n", "\t\t\t\tvar type = src.nodeName ? src.nodeName.toLowerCase() : '';\n", "\t\t\n", "\t\t\t\treturn col !== undefined || type == 'td' || type == 'th' ?\n", "\t\t\t\t\tapi.cell( src, col ).data() :\n", "\t\t\t\t\tapi.row( src ).data() || null;\n", "\t\t\t}\n", "\t\t\n", "\t\t\treturn api.data().toArray();\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Get an array of the TR nodes that are used in the table's body. Note that you will\n", "\t\t * typically want to use the '$' API method in preference to this as it is more\n", "\t\t * flexible.\n", "\t\t * @param {int} [iRow] Optional row index for the TR element you want\n", "\t\t * @returns {array|node} If iRow is undefined, returns an array of all TR elements\n", "\t\t * in the table's body, or iRow is defined, just the TR element requested.\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Get the nodes from the table\n", "\t\t * var nNodes = oTable.fnGetNodes( );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnGetNodes = function( iRow )\n", "\t\t{\n", "\t\t\tvar api = this.api( true );\n", "\t\t\n", "\t\t\treturn iRow !== undefined ?\n", "\t\t\t\tapi.row( iRow ).node() :\n", "\t\t\t\tapi.rows().nodes().flatten().toArray();\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Get the array indexes of a particular cell from it's DOM element\n", "\t\t * and column index including hidden columns\n", "\t\t * @param {node} node this can either be a TR, TD or TH in the table's body\n", "\t\t * @returns {int} If nNode is given as a TR, then a single index is returned, or\n", "\t\t * if given as a cell, an array of [row index, column index (visible),\n", "\t\t * column index (all)] is given.\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * $('#example tbody td').click( function () {\n", "\t\t * // Get the position of the current data from the node\n", "\t\t * var aPos = oTable.fnGetPosition( this );\n", "\t\t *\n", "\t\t * // Get the data array for this row\n", "\t\t * var aData = oTable.fnGetData( aPos[0] );\n", "\t\t *\n", "\t\t * // Update the data array and return the value\n", "\t\t * aData[ aPos[1] ] = 'clicked';\n", "\t\t * this.innerHTML = 'clicked';\n", "\t\t * } );\n", "\t\t *\n", "\t\t * // Init DataTables\n", "\t\t * oTable = $('#example').dataTable();\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnGetPosition = function( node )\n", "\t\t{\n", "\t\t\tvar api = this.api( true );\n", "\t\t\tvar nodeName = node.nodeName.toUpperCase();\n", "\t\t\n", "\t\t\tif ( nodeName == 'TR' ) {\n", "\t\t\t\treturn api.row( node ).index();\n", "\t\t\t}\n", "\t\t\telse if ( nodeName == 'TD' || nodeName == 'TH' ) {\n", "\t\t\t\tvar cell = api.cell( node ).index();\n", "\t\t\n", "\t\t\t\treturn [\n", "\t\t\t\t\tcell.row,\n", "\t\t\t\t\tcell.columnVisible,\n", "\t\t\t\t\tcell.column\n", "\t\t\t\t];\n", "\t\t\t}\n", "\t\t\treturn null;\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Check to see if a row is 'open' or not.\n", "\t\t * @param {node} nTr the table row to check\n", "\t\t * @returns {boolean} true if the row is currently open, false otherwise\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable;\n", "\t\t *\n", "\t\t * // 'open' an information row when a row is clicked on\n", "\t\t * $('#example tbody tr').click( function () {\n", "\t\t * if ( oTable.fnIsOpen(this) ) {\n", "\t\t * oTable.fnClose( this );\n", "\t\t * } else {\n", "\t\t * oTable.fnOpen( this, \"Temporary row opened\", \"info_row\" );\n", "\t\t * }\n", "\t\t * } );\n", "\t\t *\n", "\t\t * oTable = $('#example').dataTable();\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnIsOpen = function( nTr )\n", "\t\t{\n", "\t\t\treturn this.api( true ).row( nTr ).child.isShown();\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * This function will place a new row directly after a row which is currently\n", "\t\t * on display on the page, with the HTML contents that is passed into the\n", "\t\t * function. This can be used, for example, to ask for confirmation that a\n", "\t\t * particular record should be deleted.\n", "\t\t * @param {node} nTr The table row to 'open'\n", "\t\t * @param {string|node|jQuery} mHtml The HTML to put into the row\n", "\t\t * @param {string} sClass Class to give the new TD cell\n", "\t\t * @returns {node} The row opened. Note that if the table row passed in as the\n", "\t\t * first parameter, is not found in the table, this method will silently\n", "\t\t * return.\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable;\n", "\t\t *\n", "\t\t * // 'open' an information row when a row is clicked on\n", "\t\t * $('#example tbody tr').click( function () {\n", "\t\t * if ( oTable.fnIsOpen(this) ) {\n", "\t\t * oTable.fnClose( this );\n", "\t\t * } else {\n", "\t\t * oTable.fnOpen( this, \"Temporary row opened\", \"info_row\" );\n", "\t\t * }\n", "\t\t * } );\n", "\t\t *\n", "\t\t * oTable = $('#example').dataTable();\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnOpen = function( nTr, mHtml, sClass )\n", "\t\t{\n", "\t\t\treturn this.api( true )\n", "\t\t\t\t.row( nTr )\n", "\t\t\t\t.child( mHtml, sClass )\n", "\t\t\t\t.show()\n", "\t\t\t\t.child()[0];\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Change the pagination - provides the internal logic for pagination in a simple API\n", "\t\t * function. With this function you can have a DataTables table go to the next,\n", "\t\t * previous, first or last pages.\n", "\t\t * @param {string|int} mAction Paging action to take: \"first\", \"previous\", \"next\" or \"last\"\n", "\t\t * or page number to jump to (integer), note that page 0 is the first page.\n", "\t\t * @param {bool} [bRedraw=true] Redraw the table or not\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t * oTable.fnPageChange( 'next' );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnPageChange = function ( mAction, bRedraw )\n", "\t\t{\n", "\t\t\tvar api = this.api( true ).page( mAction );\n", "\t\t\n", "\t\t\tif ( bRedraw === undefined || bRedraw ) {\n", "\t\t\t\tapi.draw(false);\n", "\t\t\t}\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Show a particular column\n", "\t\t * @param {int} iCol The column whose display should be changed\n", "\t\t * @param {bool} bShow Show (true) or hide (false) the column\n", "\t\t * @param {bool} [bRedraw=true] Redraw the table or not\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Hide the second column after initialisation\n", "\t\t * oTable.fnSetColumnVis( 1, false );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnSetColumnVis = function ( iCol, bShow, bRedraw )\n", "\t\t{\n", "\t\t\tvar api = this.api( true ).column( iCol ).visible( bShow );\n", "\t\t\n", "\t\t\tif ( bRedraw === undefined || bRedraw ) {\n", "\t\t\t\tapi.columns.adjust().draw();\n", "\t\t\t}\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Get the settings for a particular table for external manipulation\n", "\t\t * @returns {object} DataTables settings object. See\n", "\t\t * {@link DataTable.models.oSettings}\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t * var oSettings = oTable.fnSettings();\n", "\t\t *\n", "\t\t * // Show an example parameter from the settings\n", "\t\t * alert( oSettings._iDisplayStart );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnSettings = function()\n", "\t\t{\n", "\t\t\treturn _fnSettingsFromNode( this[_ext.iApiIndex] );\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Sort the table by a particular column\n", "\t\t * @param {int} iCol the data index to sort on. Note that this will not match the\n", "\t\t * 'display index' if you have hidden data entries\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Sort immediately with columns 0 and 1\n", "\t\t * oTable.fnSort( [ [0,'asc'], [1,'asc'] ] );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnSort = function( aaSort )\n", "\t\t{\n", "\t\t\tthis.api( true ).order( aaSort ).draw();\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Attach a sort listener to an element for a given column\n", "\t\t * @param {node} nNode the element to attach the sort listener to\n", "\t\t * @param {int} iColumn the column that a click on this node will sort on\n", "\t\t * @param {function} [fnCallback] callback function when sort is run\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t *\n", "\t\t * // Sort on column 1, when 'sorter' is clicked on\n", "\t\t * oTable.fnSortListener( document.getElementById('sorter'), 1 );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnSortListener = function( nNode, iColumn, fnCallback )\n", "\t\t{\n", "\t\t\tthis.api( true ).order.listener( nNode, iColumn, fnCallback );\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Update a table cell or row - this method will accept either a single value to\n", "\t\t * update the cell with, an array of values with one element for each column or\n", "\t\t * an object in the same format as the original data source. The function is\n", "\t\t * self-referencing in order to make the multi column updates easier.\n", "\t\t * @param {object|array|string} mData Data to update the cell/row with\n", "\t\t * @param {node|int} mRow TR element you want to update or the aoData index\n", "\t\t * @param {int} [iColumn] The column to update, give as null or undefined to\n", "\t\t * update a whole row.\n", "\t\t * @param {bool} [bRedraw=true] Redraw the table or not\n", "\t\t * @param {bool} [bAction=true] Perform pre-draw actions or not\n", "\t\t * @returns {int} 0 on success, 1 on error\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t * oTable.fnUpdate( 'Example update', 0, 0 ); // Single cell\n", "\t\t * oTable.fnUpdate( ['a', 'b', 'c', 'd', 'e'], $('tbody tr')[0] ); // Row\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )\n", "\t\t{\n", "\t\t\tvar api = this.api( true );\n", "\t\t\n", "\t\t\tif ( iColumn === undefined || iColumn === null ) {\n", "\t\t\t\tapi.row( mRow ).data( mData );\n", "\t\t\t}\n", "\t\t\telse {\n", "\t\t\t\tapi.cell( mRow, iColumn ).data( mData );\n", "\t\t\t}\n", "\t\t\n", "\t\t\tif ( bAction === undefined || bAction ) {\n", "\t\t\t\tapi.columns.adjust();\n", "\t\t\t}\n", "\t\t\n", "\t\t\tif ( bRedraw === undefined || bRedraw ) {\n", "\t\t\t\tapi.draw();\n", "\t\t\t}\n", "\t\t\treturn 0;\n", "\t\t};\n", "\t\t\n", "\t\t\n", "\t\t/**\n", "\t\t * Provide a common method for plug-ins to check the version of DataTables being used, in order\n", "\t\t * to ensure compatibility.\n", "\t\t * @param {string} sVersion Version string to check for, in the format \"X.Y.Z\". Note that the\n", "\t\t * formats \"X\" and \"X.Y\" are also acceptable.\n", "\t\t * @returns {boolean} true if this version of DataTables is greater or equal to the required\n", "\t\t * version, or false if this version of DataTales is not suitable\n", "\t\t * @method\n", "\t\t * @dtopt API\n", "\t\t * @deprecated Since v1.10\n", "\t\t *\n", "\t\t * @example\n", "\t\t * $(document).ready(function() {\n", "\t\t * var oTable = $('#example').dataTable();\n", "\t\t * alert( oTable.fnVersionCheck( '1.9.0' ) );\n", "\t\t * } );\n", "\t\t */\n", "\t\tthis.fnVersionCheck = _ext.fnVersionCheck;\n", "\t\t\n", "\n", "\t\tvar _that = this;\n", "\t\tvar emptyInit = options === undefined;\n", "\t\tvar len = this.length;\n", "\n", "\t\tif ( emptyInit ) {\n", "\t\t\toptions = {};\n", "\t\t}\n", "\n", "\t\tthis.oApi = this.internal = _ext.internal;\n", "\n", "\t\t// Extend with old style plug-in API methods\n", "\t\tfor ( var fn in DataTable.ext.internal ) {\n", "\t\t\tif ( fn ) {\n", "\t\t\t\tthis[fn] = _fnExternApiFunc(fn);\n", "\t\t\t}\n", "\t\t}\n", "\n", "\t\tthis.each(function() {\n", "\t\t\t// For each initialisation we want to give it a clean initialisation\n", "\t\t\t// object that can be bashed around\n", "\t\t\tvar o = {};\n", "\t\t\tvar oInit = len > 1 ? // optimisation for single table case\n", "\t\t\t\t_fnExtend( o, options, true ) :\n", "\t\t\t\toptions;\n", "\n", "\t\t\t/*global oInit,_that,emptyInit*/\n", "\t\t\tvar i=0, iLen, j, jLen, k, kLen;\n", "\t\t\tvar sId = this.getAttribute( 'id' );\n", "\t\t\tvar bInitHandedOff = false;\n", "\t\t\tvar defaults = DataTable.defaults;\n", "\t\t\tvar $this = $(this);\n", "\t\t\t\n", "\t\t\t\n", "\t\t\t/* Sanity check */\n", "\t\t\tif ( this.nodeName.toLowerCase() != 'table' )\n", "\t\t\t{\n", "\t\t\t\t_fnLog( null, 0, 'Non-table node initialisation ('+this.nodeName+')', 2 );\n", "\t\t\t\treturn;\n", "\t\t\t}\n", "\t\t\t\n", "\t\t\t/* Backwards compatibility for the defaults */\n", "\t\t\t_fnCompatOpts( defaults );\n", "\t\t\t_fnCompatCols( defaults.column );\n", "\t\t\t\n", "\t\t\t/* Convert the camel-case defaults to Hungarian */\n", "\t\t\t_fnCamelToHungarian( defaults, defaults, true );\n", "\t\t\t_fnCamelToHungarian( defaults.column, defaults.column, true );\n", "\t\t\t\n", "\t\t\t/* Setting up the initialisation object */\n", "\t\t\t_fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ) );\n", "\t\t\t\n", "\t\t\t\n", "\t\t\t\n", "\t\t\t/* Check to see if we are re-initialising a table */\n", "\t\t\tvar allSettings = DataTable.settings;\n", "\t\t\tfor ( i=0, iLen=allSettings.length ; i').appendTo($this);\n", "\t\t\t\t}\n", "\t\t\t\toSettings.nTHead = thead[0];\n", "\t\t\t\n", "\t\t\t\tvar tbody = $this.children('tbody');\n", "\t\t\t\tif ( tbody.length === 0 ) {\n", "\t\t\t\t\ttbody = $('').appendTo($this);\n", "\t\t\t\t}\n", "\t\t\t\toSettings.nTBody = tbody[0];\n", "\t\t\t\n", "\t\t\t\tvar tfoot = $this.children('tfoot');\n", "\t\t\t\tif ( tfoot.length === 0 && captions.length > 0 && (oSettings.oScroll.sX !== \"\" || oSettings.oScroll.sY !== \"\") ) {\n", "\t\t\t\t\t// If we are a scrolling table, and no footer has been given, then we need to create\n", "\t\t\t\t\t// a tfoot element for the caption element to be appended to\n", "\t\t\t\t\ttfoot = $('').appendTo($this);\n", "\t\t\t\t}\n", "\t\t\t\n", "\t\t\t\tif ( tfoot.length === 0 || tfoot.children().length === 0 ) {\n", "\t\t\t\t\t$this.addClass( oClasses.sNoFooter );\n", "\t\t\t\t}\n", "\t\t\t\telse if ( tfoot.length > 0 ) {\n", "\t\t\t\t\toSettings.nTFoot = tfoot[0];\n", "\t\t\t\t\t_fnDetectHeader( oSettings.aoFooter, oSettings.nTFoot );\n", "\t\t\t\t}\n", "\t\t\t\n", "\t\t\t\t/* Check if there is data passing into the constructor */\n", "\t\t\t\tif ( oInit.aaData ) {\n", "\t\t\t\t\tfor ( i=0 ; i/g;\n", "\t\n", "\t// This is not strict ISO8601 - Date.parse() is quite lax, although\n", "\t// implementations differ between browsers.\n", "\tvar _re_date = /^\\d{2,4}[\\.\\/\\-]\\d{1,2}[\\.\\/\\-]\\d{1,2}([T ]{1}\\d{1,2}[:\\.]\\d{2}([\\.:]\\d{2})?)?$/;\n", "\t\n", "\t// Escape regular expression special characters\n", "\tvar _re_escape_regex = new RegExp( '(\\\\' + [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\\\', '$', '^', '-' ].join('|\\\\') + ')', 'g' );\n", "\t\n", "\t// http://en.wikipedia.org/wiki/Foreign_exchange_market\n", "\t// - \\u20BD - Russian ruble.\n", "\t// - \\u20a9 - South Korean Won\n", "\t// - \\u20BA - Turkish Lira\n", "\t// - \\u20B9 - Indian Rupee\n", "\t// - R - Brazil (R$) and South Africa\n", "\t// - fr - Swiss Franc\n", "\t// - kr - Swedish krona, Norwegian krone and Danish krone\n", "\t// - \\u2009 is thin space and \\u202F is narrow no-break space, both used in many\n", "\t// standards as thousands separators.\n", "\tvar _re_formatted_numeric = /[',$£€¥%\\u2009\\u202F\\u20BD\\u20a9\\u20BArfk]/gi;\n", "\t\n", "\t\n", "\tvar _empty = function ( d ) {\n", "\t\treturn !d || d === true || d === '-' ? true : false;\n", "\t};\n", "\t\n", "\t\n", "\tvar _intVal = function ( s ) {\n", "\t\tvar integer = parseInt( s, 10 );\n", "\t\treturn !isNaN(integer) && isFinite(s) ? integer : null;\n", "\t};\n", "\t\n", "\t// Convert from a formatted number with characters other than `.` as the\n", "\t// decimal place, to a Javascript number\n", "\tvar _numToDecimal = function ( num, decimalPoint ) {\n", "\t\t// Cache created regular expressions for speed as this function is called often\n", "\t\tif ( ! _re_dic[ decimalPoint ] ) {\n", "\t\t\t_re_dic[ decimalPoint ] = new RegExp( _fnEscapeRegex( decimalPoint ), 'g' );\n", "\t\t}\n", "\t\treturn typeof num === 'string' && decimalPoint !== '.' ?\n", "\t\t\tnum.replace( /\\./g, '' ).replace( _re_dic[ decimalPoint ], '.' ) :\n", "\t\t\tnum;\n", "\t};\n", "\t\n", "\t\n", "\tvar _isNumber = function ( d, decimalPoint, formatted ) {\n", "\t\tvar strType = typeof d === 'string';\n", "\t\n", "\t\t// If empty return immediately so there must be a number if it is a\n", "\t\t// formatted string (this stops the string \"k\", or \"kr\", etc being detected\n", "\t\t// as a formatted number for currency\n", "\t\tif ( _empty( d ) ) {\n", "\t\t\treturn true;\n", "\t\t}\n", "\t\n", "\t\tif ( decimalPoint && strType ) {\n", "\t\t\td = _numToDecimal( d, decimalPoint );\n", "\t\t}\n", "\t\n", "\t\tif ( formatted && strType ) {\n", "\t\t\td = d.replace( _re_formatted_numeric, '' );\n", "\t\t}\n", "\t\n", "\t\treturn !isNaN( parseFloat(d) ) && isFinite( d );\n", "\t};\n", "\t\n", "\t\n", "\t// A string without HTML in it can be considered to be HTML still\n", "\tvar _isHtml = function ( d ) {\n", "\t\treturn _empty( d ) || typeof d === 'string';\n", "\t};\n", "\t\n", "\t\n", "\tvar _htmlNumeric = function ( d, decimalPoint, formatted ) {\n", "\t\tif ( _empty( d ) ) {\n", "\t\t\treturn true;\n", "\t\t}\n", "\t\n", "\t\tvar html = _isHtml( d );\n", "\t\treturn ! html ?\n", "\t\t\tnull :\n", "\t\t\t_isNumber( _stripHtml( d ), decimalPoint, formatted ) ?\n", "\t\t\t\ttrue :\n", "\t\t\t\tnull;\n", "\t};\n", "\t\n", "\t\n", "\tvar _pluck = function ( a, prop, prop2 ) {\n", "\t\tvar out = [];\n", "\t\tvar i=0, ien=a.length;\n", "\t\n", "\t\t// Could have the test in the loop for slightly smaller code, but speed\n", "\t\t// is essential here\n", "\t\tif ( prop2 !== undefined ) {\n", "\t\t\tfor ( ; i')\n", "\t\t\t\t.css( {\n", "\t\t\t\t\tposition: 'fixed',\n", "\t\t\t\t\ttop: 0,\n", "\t\t\t\t\tleft: $(window).scrollLeft()*-1, // allow for scrolling\n", "\t\t\t\t\theight: 1,\n", "\t\t\t\t\twidth: 1,\n", "\t\t\t\t\toverflow: 'hidden'\n", "\t\t\t\t} )\n", "\t\t\t\t.append(\n", "\t\t\t\t\t$('
')\n", "\t\t\t\t\t\t.css( {\n", "\t\t\t\t\t\t\tposition: 'absolute',\n", "\t\t\t\t\t\t\ttop: 1,\n", "\t\t\t\t\t\t\tleft: 1,\n", "\t\t\t\t\t\t\twidth: 100,\n", "\t\t\t\t\t\t\toverflow: 'scroll'\n", "\t\t\t\t\t\t} )\n", "\t\t\t\t\t\t.append(\n", "\t\t\t\t\t\t\t$('
')\n", "\t\t\t\t\t\t\t\t.css( {\n", "\t\t\t\t\t\t\t\t\twidth: '100%',\n", "\t\t\t\t\t\t\t\t\theight: 10\n", "\t\t\t\t\t\t\t\t} )\n", "\t\t\t\t\t\t)\n", "\t\t\t\t)\n", "\t\t\t\t.appendTo( 'body' );\n", "\t\n", "\t\t\tvar outer = n.children();\n", "\t\t\tvar inner = outer.children();\n", "\t\n", "\t\t\t// Numbers below, in order, are:\n", "\t\t\t// inner.offsetWidth, inner.clientWidth, outer.offsetWidth, outer.clientWidth\n", "\t\t\t//\n", "\t\t\t// IE6 XP: 100 100 100 83\n", "\t\t\t// IE7 Vista: 100 100 100 83\n", "\t\t\t// IE 8+ Windows: 83 83 100 83\n", "\t\t\t// Evergreen Windows: 83 83 100 83\n", "\t\t\t// Evergreen Mac with scrollbars: 85 85 100 85\n", "\t\t\t// Evergreen Mac without scrollbars: 100 100 100 100\n", "\t\n", "\t\t\t// Get scrollbar width\n", "\t\t\tbrowser.barWidth = outer[0].offsetWidth - outer[0].clientWidth;\n", "\t\n", "\t\t\t// IE6/7 will oversize a width 100% element inside a scrolling element, to\n", "\t\t\t// include the width of the scrollbar, while other browsers ensure the inner\n", "\t\t\t// element is contained without forcing scrolling\n", "\t\t\tbrowser.bScrollOversize = inner[0].offsetWidth === 100 && outer[0].clientWidth !== 100;\n", "\t\n", "\t\t\t// In rtl text layout, some browsers (most, but not all) will place the\n", "\t\t\t// scrollbar on the left, rather than the right.\n", "\t\t\tbrowser.bScrollbarLeft = Math.round( inner.offset().left ) !== 1;\n", "\t\n", "\t\t\t// IE8- don't provide height and width for getBoundingClientRect\n", "\t\t\tbrowser.bBounding = n[0].getBoundingClientRect().width ? true : false;\n", "\t\n", "\t\t\tn.remove();\n", "\t\t}\n", "\t\n", "\t\t$.extend( settings.oBrowser, DataTable.__browser );\n", "\t\tsettings.oScroll.iBarWidth = DataTable.__browser.barWidth;\n", "\t}\n", "\t\n", "\t\n", "\t/**\n", "\t * Array.prototype reduce[Right] method, used for browsers which don't support\n", "\t * JS 1.6. Done this way to reduce code size, since we iterate either way\n", "\t * @param {object} settings dataTables settings object\n", "\t * @memberof DataTable#oApi\n", "\t */\n", "\tfunction _fnReduce ( that, fn, init, start, end, inc )\n", "\t{\n", "\t\tvar\n", "\t\t\ti = start,\n", "\t\t\tvalue,\n", "\t\t\tisSet = false;\n", "\t\n", "\t\tif ( init !== undefined ) {\n", "\t\t\tvalue = init;\n", "\t\t\tisSet = true;\n", "\t\t}\n", "\t\n", "\t\twhile ( i !== end ) {\n", "\t\t\tif ( ! that.hasOwnProperty(i) ) {\n", "\t\t\t\tcontinue;\n", "\t\t\t}\n", "\t\n", "\t\t\tvalue = isSet ?\n", "\t\t\t\tfn( value, that[i], i, that ) :\n", "\t\t\t\tthat[i];\n", "\t\n", "\t\t\tisSet = true;\n", "\t\t\ti += inc;\n", "\t\t}\n", "\t\n", "\t\treturn value;\n", "\t}\n", "\t\n", "\t/**\n", "\t * Add a column to the list used for the table with default values\n", "\t * @param {object} oSettings dataTables settings object\n", "\t * @param {node} nTh The th element for this column\n", "\t * @memberof DataTable#oApi\n", "\t */\n", "\tfunction _fnAddColumn( oSettings, nTh )\n", "\t{\n", "\t\t// Add column to aoColumns array\n", "\t\tvar oDefaults = DataTable.defaults.column;\n", "\t\tvar iCol = oSettings.aoColumns.length;\n", "\t\tvar oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {\n", "\t\t\t\"nTh\": nTh ? nTh : document.createElement('th'),\n", "\t\t\t\"sTitle\": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '',\n", "\t\t\t\"aDataSort\": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol],\n", "\t\t\t\"mData\": oDefaults.mData ? oDefaults.mData : iCol,\n", "\t\t\tidx: iCol\n", "\t\t} );\n", "\t\toSettings.aoColumns.push( oCol );\n", "\t\n", "\t\t// Add search object for column specific search. Note that the `searchCols[ iCol ]`\n", "\t\t// passed into extend can be undefined. This allows the user to give a default\n", "\t\t// with only some of the parameters defined, and also not give a default\n", "\t\tvar searchCols = oSettings.aoPreSearchCols;\n", "\t\tsearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch, searchCols[ iCol ] );\n", "\t\n", "\t\t// Use the default column options function to initialise classes etc\n", "\t\t_fnColumnOptions( oSettings, iCol, $(nTh).data() );\n", "\t}\n", "\t\n", "\t\n", "\t/**\n", "\t * Apply options for a column\n", "\t * @param {object} oSettings dataTables settings object\n", "\t * @param {int} iCol column index to consider\n", "\t * @param {object} oOptions object with sType, bVisible and bSearchable etc\n", "\t * @memberof DataTable#oApi\n", "\t */\n", "\tfunction _fnColumnOptions( oSettings, iCol, oOptions )\n", "\t{\n", "\t\tvar oCol = oSettings.aoColumns[ iCol ];\n", "\t\tvar oClasses = oSettings.oClasses;\n", "\t\tvar th = $(oCol.nTh);\n", "\t\n", "\t\t// Try to get width information from the DOM. We can't get it from CSS\n", "\t\t// as we'd need to parse the CSS stylesheet. `width` option can override\n", "\t\tif ( ! oCol.sWidthOrig ) {\n", "\t\t\t// Width attribute\n", "\t\t\toCol.sWidthOrig = th.attr('width') || null;\n", "\t\n", "\t\t\t// Style attribute\n", "\t\t\tvar t = (th.attr('style') || '').match(/width:\\s*(\\d+[pxem%]+)/);\n", "\t\t\tif ( t ) {\n", "\t\t\t\toCol.sWidthOrig = t[1];\n", "\t\t\t}\n", "\t\t}\n", "\t\n", "\t\t/* User specified column options */\n", "\t\tif ( oOptions !== undefined && oOptions !== null )\n", "\t\t{\n", "\t\t\t// Backwards compatibility\n", "\t\t\t_fnCompatCols( oOptions );\n", "\t\n", "\t\t\t// Map camel case parameters to their Hungarian counterparts\n", "\t\t\t_fnCamelToHungarian( DataTable.defaults.column, oOptions );\n", "\t\n", "\t\t\t/* Backwards compatibility for mDataProp */\n", "\t\t\tif ( oOptions.mDataProp !== undefined && !oOptions.mData )\n", "\t\t\t{\n", "\t\t\t\toOptions.mData = oOptions.mDataProp;\n", "\t\t\t}\n", "\t\n", "\t\t\tif ( oOptions.sType )\n", "\t\t\t{\n", "\t\t\t\toCol._sManualType = oOptions.sType;\n", "\t\t\t}\n", "\t\n", "\t\t\t// `class` is a reserved word in Javascript, so we need to provide\n", "\t\t\t// the ability to use a valid name for the camel case input\n", "\t\t\tif ( oOptions.className && ! oOptions.sClass )\n", "\t\t\t{\n", "\t\t\t\toOptions.sClass = oOptions.className;\n", "\t\t\t}\n", "\t\t\tif ( oOptions.sClass ) {\n", "\t\t\t\tth.addClass( oOptions.sClass );\n", "\t\t\t}\n", "\t\n", "\t\t\t$.extend( oCol, oOptions );\n", "\t\t\t_fnMap( oCol, oOptions, \"sWidth\", \"sWidthOrig\" );\n", "\t\n", "\t\t\t/* iDataSort to be applied (backwards compatibility), but aDataSort will take\n", "\t\t\t * priority if defined\n", "\t\t\t */\n", "\t\t\tif ( oOptions.iDataSort !== undefined )\n", "\t\t\t{\n", "\t\t\t\toCol.aDataSort = [ oOptions.iDataSort ];\n", "\t\t\t}\n", "\t\t\t_fnMap( oCol, oOptions, \"aDataSort\" );\n", "\t\t}\n", "\t\n", "\t\t/* Cache the data get and set functions for speed */\n", "\t\tvar mDataSrc = oCol.mData;\n", "\t\tvar mData = _fnGetObjectDataFn( mDataSrc );\n", "\t\tvar mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null;\n", "\t\n", "\t\tvar attrTest = function( src ) {\n", "\t\t\treturn typeof src === 'string' && src.indexOf('@') !== -1;\n", "\t\t};\n", "\t\toCol._bAttrSrc = $.isPlainObject( mDataSrc ) && (\n", "\t\t\tattrTest(mDataSrc.sort) || attrTest(mDataSrc.type) || attrTest(mDataSrc.filter)\n", "\t\t);\n", "\t\toCol._setter = null;\n", "\t\n", "\t\toCol.fnGetData = function (rowData, type, meta) {\n", "\t\t\tvar innerData = mData( rowData, type, undefined, meta );\n", "\t\n", "\t\t\treturn mRender && type ?\n", "\t\t\t\tmRender( innerData, type, rowData, meta ) :\n", "\t\t\t\tinnerData;\n", "\t\t};\n", "\t\toCol.fnSetData = function ( rowData, val, meta ) {\n", "\t\t\treturn _fnSetObjectDataFn( mDataSrc )( rowData, val, meta );\n", "\t\t};\n", "\t\n", "\t\t// Indicate if DataTables should read DOM data as an object or array\n", "\t\t// Used in _fnGetRowElements\n", "\t\tif ( typeof mDataSrc !== 'number' ) {\n", "\t\t\toSettings._rowReadObject = true;\n", "\t\t}\n", "\t\n", "\t\t/* Feature sorting overrides column specific when off */\n", "\t\tif ( !oSettings.oFeatures.bSort )\n", "\t\t{\n", "\t\t\toCol.bSortable = false;\n", "\t\t\tth.addClass( oClasses.sSortableNone ); // Have to add class here as order event isn't called\n", "\t\t}\n", "\t\n", "\t\t/* Check that the class assignment is correct for sorting */\n", "\t\tvar bAsc = $.inArray('asc', oCol.asSorting) !== -1;\n", "\t\tvar bDesc = $.inArray('desc', oCol.asSorting) !== -1;\n", "\t\tif ( !oCol.bSortable || (!bAsc && !bDesc) )\n", "\t\t{\n", "\t\t\toCol.sSortingClass = oClasses.sSortableNone;\n", "\t\t\toCol.sSortingClassJUI = \"\";\n", "\t\t}\n", "\t\telse if ( bAsc && !bDesc )\n", "\t\t{\n", "\t\t\toCol.sSortingClass = oClasses.sSortableAsc;\n", "\t\t\toCol.sSortingClassJUI = oClasses.sSortJUIAscAllowed;\n", "\t\t}\n", "\t\telse if ( !bAsc && bDesc )\n", "\t\t{\n", "\t\t\toCol.sSortingClass = oClasses.sSortableDesc;\n", "\t\t\toCol.sSortingClassJUI = oClasses.sSortJUIDescAllowed;\n", "\t\t}\n", "\t\telse\n", "\t\t{\n", "\t\t\toCol.sSortingClass = oClasses.sSortable;\n", "\t\t\toCol.sSortingClassJUI = oClasses.sSortJUI;\n", "\t\t}\n", "\t}\n", "\t\n", "\t\n", "\t/**\n", "\t * Adjust the table column widths for new data. Note: you would probably want to\n", "\t * do a redraw after calling this function!\n", "\t * @param {object} settings dataTables settings object\n", "\t * @memberof DataTable#oApi\n", "\t */\n", "\tfunction _fnAdjustColumnSizing ( settings )\n", "\t{\n", "\t\t/* Not interested in doing column width calculation if auto-width is disabled */\n", "\t\tif ( settings.oFeatures.bAutoWidth !== false )\n", "\t\t{\n", "\t\t\tvar columns = settings.aoColumns;\n", "\t\n", "\t\t\t_fnCalculateColumnWidths( settings );\n", "\t\t\tfor ( var i=0 , iLen=columns.length ; i