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/3_ajax/aaSortingFixed.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.8 KB
Line 
1// DATA_TEMPLATE: empty_table
2oTest.fnStart( "aaSortingFixed" );
3
4$(document).ready( function () {
5  /* Check the default */
6  var oTable = $('#example').dataTable( {
7    "sAjaxSource": "../../../examples/examples_support/json_source.txt"
8  } );
9  var oSettings = oTable.fnSettings();
10 
11  oTest.fnWaitTest(
12    "No fixed sorting by default",
13    null,
14    function () {
15      return oSettings.aaSortingFixed == null;
16    }
17  );
18 
19 
20  oTest.fnWaitTest(
21    "Fixed sorting on first column (string/asc) with user sorting on second column (string/asc)",
22    function () {
23      oSession.fnRestore();
24      $('#example').dataTable( {
25        "sAjaxSource": "../../../examples/examples_support/json_source.txt",
26        "aaSortingFixed": [['0','asc']],
27        "fnInitComplete": function () {
28          $('#example thead th:eq(1)').click();
29        }
30      } );
31      //
32    },
33    function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
34  );
35 
36  oTest.fnWaitTest(
37    "Fixed sorting on first column (string/asc) with user sorting on second column (string/desc)",
38    function () {
39      $('#example thead th:eq(1)').click();
40    },
41    function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
42  );
43 
44  oTest.fnWaitTest(
45    "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/asc)",
46    function () {
47      oSession.fnRestore();
48      $('#example').dataTable( {
49        "sAjaxSource": "../../../examples/examples_support/json_source.txt",
50        "aaSortingFixed": [['3','asc']]
51      } );
52      $('#example thead th:eq(1)').click();
53    },
54    function () { return $('#example tbody td:eq(1)').html() == "All others"; }
55  );
56 
57  oTest.fnWaitTest(
58    "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/desc)",
59    function () {
60      $('#example thead th:eq(1)').click();
61    },
62    function () { return $('#example tbody td:eq(1)').html() == "PSP browser"; }
63  );
64 
65 
66  oTest.fnComplete();
67} );
Note: See TracBrowser for help on using the repository browser.