Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HeuristicLabWeb.PluginHost/HLWebPluginHost/Content/jQuery/jQueryPlugins/DataTables-1.7.6/media/unit_testing/tests_onhold/4_server-side/aoColumns.bUseRendered.js @ 6286

Last change on this file since 6286 was 6286, checked in by dkahn, 13 years ago

#1198 Added jQuery plus plugins

File size: 1.0 KB
Line 
1// DATA_TEMPLATE: empty_table
2oTest.fnStart( "aoColumns.bUseRendered" );
3
4/* bUseRendered is used to alter sorting data, if false then the original data is used for
5 * sorting rather than the rendered data
6 */
7
8$(document).ready( function () {
9  /* Check the default */
10  var mTmp = 0;
11 
12  var oTable = $('#example').dataTable( {
13    "bServerSide": true,
14    "sAjaxSource": "../../../examples/examples_support/server_processing.php",
15    "aoColumns": [
16      null,
17      { "fnRender": function (a) {
18        if ( mTmp == 0 ) {
19          mTmp++;
20          return "aaa";
21        } else
22          return a.aData[a.iDataColumn];
23      } },
24      null,
25      null,
26      null
27    ]
28  } );
29  var oSettings = oTable.fnSettings();
30 
31  oTest.fnWaitTest(
32    "Default for bUseRendered is true - rendered data is used for sorting",
33    function () { $('#example thead th:eq(1)').click(); },
34    function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == 'aaa'; }
35  );
36 
37  /* Limited to what we can do here as the sorting is done on the server side. So stop here. */
38 
39 
40 
41 
42  oTest.fnComplete();
43} );
Note: See TracBrowser for help on using the repository browser.