2 oTest.fnStart( "Actions on a scrolling table keep width" );
5 $(document).ready( function () {
6 var oTable = $('#example').dataTable( {
13 var iWidth = $('div.dataTables_wrapper').width();
16 "First sort has no effect on width",
17 function () { $('th:eq(1)').click(); },
18 function () { return $('div.dataTables_wrapper').width() == iWidth; }
22 "Second sort has no effect on width",
23 function () { $('th:eq(1)').click(); },
24 function () { return $('div.dataTables_wrapper').width() == iWidth; }
28 "Third sort has no effect on width",
29 function () { $('th:eq(2)').click(); },
30 function () { return $('div.dataTables_wrapper').width() == iWidth; }
34 "Filter has no effect on width",
35 function () { oTable.fnFilter('i'); },
36 function () { return $('div.dataTables_wrapper').width() == iWidth; }
40 "Filter 2 has no effect on width",
41 function () { oTable.fnFilter('in'); },
42 function () { return $('div.dataTables_wrapper').width() == iWidth; }
46 "No result filter has header and body at same width",
47 function () { oTable.fnFilter('xxx'); },
48 function () { return $('#example').width() == $('div.dataTables_scrollHeadInner').width(); }
52 "Filter with no results has no effect on width",
53 function () { oTable.fnFilter('xxx'); },
54 function () { return $('div.dataTables_wrapper').width() == iWidth; }
58 "Filter with no results has table equal to wrapper width",
59 function () { oTable.fnFilter('xxx'); },
60 function () { return $('div.dataTables_wrapper').width() == $('#example').width(); }