use jquery.floatThead rather than DataTables FixedHeader extension
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| [% IF opt %] | ||||
|   <table id="data-table" class="table table-striped table-bordered table-fixed-header" width="100%" cellspacing="0"> | ||||
|   <table id="data-table" class="table table-striped table-bordered nd_floatinghead" width="100%" cellspacing="0"> | ||||
|     <thead> | ||||
|       <tr> | ||||
|         <th>Device</th> | ||||
| @@ -16,7 +16,7 @@ | ||||
|     </thead>  | ||||
|   </table> | ||||
| [% ELSE %] | ||||
|   <table id="data-table" class="table table-striped table-bordered table-fixed-header" width="100%" cellspacing="0"> | ||||
|   <table id="data-table" class="table table-striped table-bordered nd_floatinghead" width="100%" cellspacing="0"> | ||||
|     <thead> | ||||
|       <tr> | ||||
|         <th>Class</th> | ||||
| @@ -31,13 +31,6 @@ function capitaliseFirstLetter(string) { | ||||
|     return string.charAt(0).toUpperCase() + string.slice(1); | ||||
| } | ||||
|  | ||||
| function fhForceRedraw(fixedHeaders) { | ||||
|     for (var i = 0; i < fixedHeaders.length; i++) { | ||||
|         fixedHeaders[i]._fnUpdateClones(true); // force redraw | ||||
|         fixedHeaders[i]._fnUpdatePositions(); | ||||
|     } | ||||
| } | ||||
|  | ||||
| $(document).ready(function() { | ||||
|     var table = $('#data-table').dataTable({ | ||||
|         "deferRender": true, | ||||
| @@ -100,30 +93,5 @@ $(document).ready(function() { | ||||
|         ] | ||||
|     }); | ||||
|  | ||||
|     var fixedHeaders = []; | ||||
|     $('.table-fixed-header').each(function() { | ||||
|         fixedHeaders.push( | ||||
|             new FixedHeader(this, { | ||||
|             'offsetTop': 40 // offset for bootstrap navbar | ||||
|         })); | ||||
|     }); | ||||
|  | ||||
|     $(window).resize(function() { | ||||
|         fhForceRedraw(fixedHeaders); | ||||
|     }); | ||||
|  | ||||
|     $('.table-fixed-header').on('draw.dt', function() { | ||||
|         fhForceRedraw(fixedHeaders); | ||||
|     }); | ||||
|  | ||||
|     $('#nd_sidebar-toggle-img-out').click(function() { | ||||
|         fhForceRedraw(fixedHeaders); | ||||
|     }); | ||||
|  | ||||
|     $('#nd_sidebar-toggle-img-in').click(function() { | ||||
|         fhForceRedraw(fixedHeaders); | ||||
|     }); | ||||
|  | ||||
|      | ||||
| }); | ||||
| </script> | ||||
| </script> | ||||
|   | ||||
| @@ -27,7 +27,6 @@ | ||||
|   <script type="text/javascript" src="[% uri_base %]/javascripts/moment.min.js"></script> | ||||
|   <script type="text/javascript" src="[% uri_base %]/javascripts/jquery.dataTables.min.js"></script> | ||||
|   <script type="text/javascript" src="[% uri_base %]/javascripts/dataTables.bootstrap.js"></script> | ||||
|   <script type="text/javascript" src="[% uri_base %]/javascripts/dataTables.fixedHeader.min.js"></script> | ||||
|   <script type="text/javascript" src="[% uri_base %]/javascripts/dataTables.ip-address-detect.js"></script> | ||||
|   <script type="text/javascript" src="[% uri_base %]/javascripts/dataTables.ip-address-sort.js"></script> | ||||
|  | ||||
| @@ -54,7 +53,6 @@ | ||||
|   <link rel="stylesheet" href="[% uri_base %]/css/bootstrap-tree.css"/> | ||||
|   <link rel="stylesheet" href="[% uri_base %]/css/daterangepicker-bs2.css"/> | ||||
|   <link rel="stylesheet" href="[% uri_base %]/css/dataTables.bootstrap.css"/> | ||||
|   <link rel="stylesheet" href="[% uri_base %]/css/dataTables.fixedHeader.css"/> | ||||
|   <link rel="stylesheet" href="[% uri_base %]/css/nd_print.css" media="print"/> | ||||
|  | ||||
|   [% FOREACH add_css IN settings._additional_css %] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user