code stringlengths 1 2.08M | language stringclasses 1
value |
|---|---|
/*
* Variable: oPagination
* Purpose:
* Scope: jQuery.fn.dataTableExt
*/
$.extend( DataTable.ext.oPagination, {
/*
* Variable: two_button
* Purpose: Standard two button (forward/back) pagination
* Scope: jQuery.fn.dataTableExt.oPagination
*/
"two_button": {
/*
* Function: oPagination.two_but... | JavaScript |
$.extend( DataTable.ext.oSort, {
/*
* text sorting
*/
"string-pre": function ( a )
{
if ( typeof a != 'string' ) {
a = (a !== null && a.toString) ? a.toString() : '';
}
return a.toLowerCase();
},
"string-asc": function ( x, y )
{
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},
"string-desc": fu... | JavaScript |
$.extend( DataTable.ext.oStdClasses, {
"sTable": "dataTable",
/* Two buttons buttons */
"sPagePrevEnabled": "paginate_enabled_previous",
"sPagePrevDisabled": "paginate_disabled_previous",
"sPageNextEnabled": "paginate_enabled_next",
"sPageNextDisabled": "paginate_disabled_next",
"sPageJUINext": "",
"sPageJUIP... | JavaScript |
$.extend( DataTable.ext.aTypes, [
/*
* Function: -
* Purpose: Check to see if a string is numeric
* Returns: string:'numeric' or null
* Inputs: mixed:sText - string to check
*/
function ( sData )
{
/* Allow zero length strings as a number */
if ( typeof sData === 'number' )
{
return 'numeric... | JavaScript |
/**
* Perform a jQuery selector action on the table's TR elements (from the tbody) and
* return the resulting jQuery object.
* @param {string|node|jQuery} sSelector jQuery selector or node collection to act on
* @param {object} [oOpts] Optional parameters for modifying the rows to be included
* @param {string} ... | JavaScript |
/**
* Provide a common method for plug-ins to check the version of DataTables being used, in order
* to ensure compatibility.
* @param {string} sVersion Version string to check for, in the format "X.Y.Z". Note that the
* formats "X" and "X.Y" are also acceptable.
* @returns {boolean} true if this version of... | JavaScript |
/*
* This is really a good bit rubbish this method of exposing the internal methods
* publicly... - To be fixed in 2.0 using methods on the prototype
*/
/**
* Create a wrapper function for exporting an internal functions to an external API.
* @param {string} sFunc API function name
* @returns {function} wrap... | JavaScript |
/**
* Initialisation options that can be given to DataTables at initialisation
* time.
* @namespace
*/
DataTable.defaults = {
/**
* An array of data to use for the table, passed in at initialisation which
* will be used in preference to any data which is already in the DOM. This is
* particularly useful... | JavaScript |
/**
* DataTables settings object - this holds all the information needed for a
* given table, including configuration, data and current application of the
* table options. DataTables does not have a single instance for each DataTable
* with the settings attached to that instance, but rather instances of the
* Da... | JavaScript |
/**
* Template object for the way in which DataTables holds information about
* search information for the global filter and individual column filters.
* @namespace
*/
DataTable.models.oSearch = {
/**
* Flag to indicate if the filtering should be case insensitive or not
* @type boolean
* @default true
... | JavaScript |
/**
* Column options that can be given to DataTables at initialisation time.
* @namespace
*/
DataTable.defaults.columns = {
/**
* Allows a column's sorting to take multiple columns into account when
* doing a sort. For example first name / last name columns make sense to
* do a multi-column sort over the... | JavaScript |
/**
* Template object for the way in which DataTables holds information about
* each individual row. This is the object format used for the settings
* aoData array.
* @namespace
*/
DataTable.models.oRow = {
/**
* TR element for the row
* @type node
* @default null
*/
"nTr": null,
/**
* Data ob... | JavaScript |
/**
* DataTables extension options and plug-ins. This namespace acts as a collection "area"
* for plug-ins that can be used to extend the default DataTables behaviour - indeed many
* of the build in methods use this method to provide their own capabilities (sorting methods
* for example).
*
* Note that this na... | JavaScript |
/**
* Template object for the column information object in DataTables. This object
* is held in the settings aoColumns array and contains all the information that
* DataTables needs about each individual column.
*
* Note that this object is related to {@link DataTable.defaults.columns}
* but this one is the ... | JavaScript |
var giTotalTestCount = 0;
var giActiveModule = 0;
var giModuleTests;
var giStartTime;
var giTest;
var gbStop = false;
var gtoTest;
function fnTestStart ( sTestInfo )
{
gaoTest[ giActiveModule ].iTests++;
document.getElementById('test_info').innerHTML +=
(giActiveModule+1)+'.'+(giModuleTests+1)+'. '+sTestInfo+'...... | JavaScript |
/*
* File: unit_test.js
* Version: 0.0.1
* CVS: $Id: unit_test.js 2 2013-10-29 05:45:34Z edwin@direightion.com $
* Description: Unit test framework
* Author: Allan Jardine (www.sprymedia.co.uk)
* Created: Sun Mar 8 22:02:49 GMT 2009
* Modified: $Date$ by $Author$
* Language: J... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "Sanity checks for DataTables with DOM data" );
oTest.fnTest(
"jQuery.dataTable function",
null,
function () { return typeof jQuery().dataTable == "function"; }
);
oTest.fnTest(
"jQuery.dataTableSettings storage array",
null,
function () { return typeof jQuery().dataTa... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "fnRowCallback" );
/* Note - fnRowCallback MUST return the first arguments (modified or not) */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender"... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.fnRender" );
$(document).ready( function () {
/* Check the default */
var mTmp = 0;
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true,
"aoColumns": [
null,
{ "fnRender": functio... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.sProcessing" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true,
"bProcessing": true
} );
var oSettings = oTable.fnSettings... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.sWidth" );
/* NOTE - we need to disable the auto width for the majority of these test in order to preform
* these tests as the auto width will convert the width to a px value. We can do 'non-exact' tests
* with auto width enabled however to ensure it scales co... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.bVisible" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bSortClasses" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
oTest.fnWaitTest(
"Sorting classes are applied by default",
null,
fun... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.sSearch" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.sTitle" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.sInfoPostFix" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTes... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bProcessing" );
/* It's actually a bit hard to set this one due to the fact that it will only be shown
* when DataTables is doing some kind of processing. The server-side processing is a bit
* better to test this than here - so we just the interal functions to enable it ... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.iDataSort" );
$(document).ready( function () {
/* Should know that sorting already works by default from other tests, so we can jump
* right in here
*/
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.bUseRendered" );
/* bUseRendered is used to alter sorting data, if false then the original data is used for
* sorting rather than the rendered data
*/
$(document).ready( function () {
/* Check the default */
var mTmp = 0;
var oTable = $('#example').dataTa... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bLengthChange" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
oTest.fnWaitTest(
"Length div exists by default",
null,
function () ... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "sPaginationType" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
"... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oSearch" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
"Default ... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.sClass" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.sName" );
/* This has no effect at all in DOM methods - so we just check that it has applied the name */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.tx... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "fnInitComplete" );
/* Fairly boring function compared to the others! */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSett... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "fnServerData for Ajax sourced data" );
$(document).ready( function () {
var mPass;
oTest.fnTest(
"Argument length",
function () {
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true,
"fnServerD... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.sInfo" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
"... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "sDom" );
/* This is going to be brutal on the browser! There is a lot that can be tested here... */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRe... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "asStripeClasses" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
oTest.fnWaitTest(
"Default row striping is applied",
null,
functio... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.bSeachable" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "fnHeaderCallback" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
var mPass, bInit;
oT... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bPaginate" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
oTest.fnWaitTest(
"Pagiantion div exists by default",
null,
function () ... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bAutoWidth" );
/* It's actually a little tricky to test this. We can't test absolute numbers because
* different browsers and different platforms will render the width of the columns slightly
* differently. However, we certainly can test the principle of what should happ... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "Custom data source property - array only" );
$(document).ready( function () {
var oInit = {
"sAjaxSource": "../../../examples/ajax/sources/array_only.txt",
"bDeferRender": true,
"sAjaxDataProp": ""
};
$('#example').dataTable( oInit );
oTest.fnWaitTest(
"10 ... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bFilter" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
oTest.fnWaitTest(
"Filtering div exists by default",
null,
function () { r... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aaSorting" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
"Defaul... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "fnDrawCallback" );
/* Fairly boring function compared to the others! */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSett... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.sInfoEmpty" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "sAjaxSource" );
/* Sanitfy check really - all the other tests blast this */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var o... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "iDisplayLength" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
oTest.fnWaitTest(
"Default length is ten",
null,
function () { retu... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bServerSide" );
/* Not interested in server-side processing here other than to check that it is off */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDefe... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.sZeroRecords" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTes... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "Sanity checks for DataTables with delayed DOM creation" );
$(document).ready( function () {
var oInit = {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
};
$('#example').dataTable( oInit );
oTest.fnWaitTest(
"10 rows shown on ... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.oPaginate" );
/* Note that the paging language information only has relevence in full numbers */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"b... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoColumns.bSortable" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest( ... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bSort" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
oTest.fnWaitTest(
"Sorting is on by default",
null,
function () { return $('... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "Custom data source property - property given" );
$(document).ready( function () {
var oInit = {
"sAjaxSource": "../../../examples/ajax/sources/custom_prop.txt",
"bDeferRender": true,
"sAjaxDataProp": "demo"
};
$('#example').dataTable( oInit );
oTest.fnWaitTest... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "bInfo" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
oTest.fnWaitTest(
"Info div exists by default",
null,
function () { return d... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aoSearchCols" );
/* We could be here forever testing this one, so we test a limited subset on a couple of colums */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.t... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.sLengthMenu" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "oLanguage.sUrl" );
/* Note that we only test the internal storage of language information pulled form a file here
* as the other language tests will check it goes into the DOM correctly
*/
$(document).ready( function () {
/* Check the default */
var oTable = $('#examp... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "aaSortingFixed" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
"bDeferRender": true
} );
var oSettings = oTable.fnSettings();
oTest.fnWaitTest(
"N... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "fnRowCallback" );
/* Note - fnRowCallback MUST return the first arguments (modified or not) */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
var mPass;
oTest.fnTest(
"Default sh... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.fnRender" );
$(document).ready( function () {
/* Check the default */
var mTmp = 0;
var oTable = $('#example').dataTable( {
"aoColumns": [
null,
{ "fnRender": function (a) {
mTmp++;
return a.aData[a.iDataColumn];
} },
null,
null,
null
... | JavaScript |
// DATA_TEMPLATE: complex_header_2
oTest.fnStart( "aoColumns.bVisible with complex headers" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"All columns are visible by default",
null,
function () { retur... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "oLanguage.sProcessing" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"bProcessing": true
} );
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Processing language is 'Processing...' by default",
null,
fu... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.sWidth" );
/* NOTE - we need to disable the auto width for the majority of these test in order to preform
* these tests as the auto width will convert the width to a px value. We can do 'non-exact' tests
* with auto width enabled however to ensure it scales colum... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.bVisible" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"All columns are visible by default",
null,
function () { return $('#example tbody tr:eq(0) ... | JavaScript |
// DATA_TEMPLATE: 6776
oTest.fnStart( "Actions on a scrolling table keep width" );
$(document).ready( function () {
var oTable = $('#example').dataTable( {
"bFilter": true,
"bSort": true,
"sScrollY": "100px",
"bPaginate": false
} );
var iWidth = $('div.dataTables_wrapper').width()... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "bSortClasses" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable();
oTest.fnTest(
"Sorting classes are applied by default",
null,
function () { return $('#example tbody tr:eq(0) td:eq(0)').hasClass('sorting_1'); }
);
oTest.fnTe... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "oLanguage.sSearch" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Search language is 'Search:' by default",
null,
function () { return oSettings.oLanguage.sSe... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.sTitle" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Column names are read from the DOM by default",
null,
function () {
var jqNodes = $('#exam... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "oLanguage.sInfoPostFix" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Info post fix language is '' (blank) by default",
null,
function () { return oSettings.... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "2746 - Stable sorting" );
$(document).ready( function () {
$('#example').dataTable();
oTest.fnTest(
"Initial sort",
null,
function () {
var ret =
$('#example tbody tr:eq(0) td:eq(0)').html() == 'Gecko' &&
$('#example tbody tr:eq(1) td:eq(0)').html() == '... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "bProcessing" );
/* It's actually a bit hard to set this one due to the fact that it will only be shown
* when DataTables is doing some kind of processing. The server-side processing is a bit
* better to test this than here - so we just the interal functions to enable it and... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.iDataSort" );
$(document).ready( function () {
/* Should know that sorting already works by default from other tests, so we can jump
* right in here
*/
var oTable = $('#example').dataTable( {
"aoColumns": [
null,
{ "iDataSort": 4 },
null,
null,
... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "2840 - Restore table width on fnDestroy" );
$(document).ready( function () {
document.cookie = "";
$('#example').dataTable( {
"sScrollX": "100%",
"sScrollXInner": "110%"
} );
$('#example').dataTable().fnDestroy();
oTest.fnTest(
"Width after destroy",
null,
f... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.bUseRendered" );
/* bUseRendered is used to alter sorting data, if false then the original data is used for
* sorting rather than the rendered data
*/
$(document).ready( function () {
/* Check the default */
var mTmp = 0;
var oTable = $('#example').dataTable... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "bLengthChange" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable();
oTest.fnTest(
"Length div exists by default",
null,
function () { return document.getElementById('example_length') != null; }
);
oTest.fnTest(
"Four default... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "Check behaviour of the data get functions that DataTables uses" );
$(document).ready( function () {
// Slightly unusual test set this one, in that we don't really care about the DOM
// but want to test the internal data handling functions but we do need a table to
// get a... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "iDraw - check that iDraw increments for each draw" );
$(document).ready( function () {
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"After first draw, iDraw is 1",
null,
function () { return oSettings.iDraw == 1; }
)... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "sPaginationType" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Check two button paging is the default",
null,
function () { return oSettings.sPaginationType ... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "oSearch" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Default values should be blank",
null,
function () {
var bReturn = oSettings.oPreviousSearch.sSearc... | JavaScript |
// DATA_TEMPLATE: dymanic_table
oTest.fnStart( "2530 - Check width's when dealing with empty strings" );
$(document).ready( function () {
$('#example').dataTable( {
"aaData": [
['','Internet Explorer 4.0','Win 95+','4','X'],
['','Internet Explorer 5.0','Win 95+','5','C']
],
"aoColumns": [
{ "sTitle": ... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.sClass" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"By default the test class hasn't been applied to the column (sanity!)",
null,
function () { r... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.sName" );
/* This has no effect at all in DOM methods - so we just check that it has applied the name */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"aoColumns": [
null,
null,
null,
{ "sName": 'un... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "fnInitComplete" );
/* Fairly boring function compared to the others! */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
var mPass;
oTest.fnTest(
"Default should be null",
null,
... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "Check behaviour of the data set functions that DataTables uses" );
$(document).ready( function () {
// Slightly unusual test set this one, in that we don't really care about the DOM
// but want to test the internal data handling functions but we do need a table to
// get a... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "bInfiniteScroll" );
$(document).ready( function () {
var oTable = $('#example').dataTable( {
"bScrollInfinite": true,
"sScrollY": "200px"
} );
oTest.fnTest(
"10 rows by default",
null,
function () { return $('#example tbody tr').length == 10; }
);
oTest.f... | JavaScript |
// DATA_TEMPLATE: empty_table
oTest.fnStart( "5396 - fnUpdate with 2D arrays for a single row" );
$(document).ready( function () {
$('#example thead tr').append( '<th>6</th>' );
$('#example thead tr').append( '<th>7</th>' );
$('#example thead tr').append( '<th>8</th>' );
$('#example thead tr').append( '<th>9</th>'... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "2914 - State saving with an empty array" );
$(document).ready( function () {
document.cookie = "";
$('#example').dataTable( {
"bStateSave": true,
"aaSorting": []
} );
oTest.fnTest(
"No sort",
null,
function () { return $('#example tbody td:eq(3)').html() == "... | JavaScript |
// DATA_TEMPLATE: dom_data_two_headers
oTest.fnStart( "bSortCellsTop" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Sorting class is on the bottom cells by default",
null,
function () { return $('#exa... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "oLanguage.sInfo" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Info language is 'Showing _START_ to _END_ of _TOTAL_ entries' by default",
null,
function () ... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "fnInfoCallback checks" );
$(document).ready( function () {
var mPass;
$('#example').dataTable();
/* Basic checks */
oTest.fnTest(
"null by default",
null,
function () { return $('#example').dataTable().fnSettings().oLanguage.fnInfoCallback == null; }
);
oTe... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "sDom" );
/* This is going to be brutal on the browser! There is a lot that can be tested here... */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Default DOM varai... | JavaScript |
// DATA_TEMPLATE: two_tables
oTest.fnStart( "Initialise two tables" );
$(document).ready( function () {
$('table.display').dataTable();
oTest.fnTest(
"Check that initialisation was okay",
null,
function () { return true; }
);
oTest.fnComplete();
} ); | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "asStripeClasses" );
$(document).ready( function () {
/* Check the default */
$('#example').dataTable();
oTest.fnTest(
"Default row striping is applied",
null,
function () {
return $('#example tbody tr:eq(0)').hasClass('odd') &&
$('#example tbody tr:eq... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "aoColumns.bSeachable" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Columns are searchable by default",
function () { oTable.fnFilter("Camino"); },
function ... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "5508 - Table container width doesn't change when filtering applied to scrolling table" );
$(document).ready( function () {
$('#example').dataTable( {
"sScrollY": "300px",
"bPaginate": false
} );
oTest.fnTest(
"Width of container 800px on init with scroll",
null,... | JavaScript |
// DATA_TEMPLATE: dom_data
oTest.fnStart( "fnCreatedRow tests" );
$(document).ready( function () {
var tmp = 0;
$('#example').dataTable( {
fnCreatedRow: function () {
tmp++;
}
} );
oTest.fnTest(
"Row created is called once for each row on init",
null,
function () { return tmp===57; }
);
oTest.... | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.