Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. jQuery(document).ready(function($)
  2.     {
  3.         //convert all checkboxes before converting datatable
  4.         replaceCheckboxes();
  5.         var datatable = $("#table_export").dataTable({
  6.             "sPaginationType": "bootstrap",
  7.             "sDom": "<'row'<'col-xs-3 col-left'l><'col-xs-9 col-right'<'export-data'T>f>r>t<'row'<'col-xs-3 col-left'i><'col-xs-9 col-right'p>>",
  8.            
  9.             "aoColumns": [
  10.                 { "bSortable": false},
  11.                 { "bSortable": true},  
  12.                 { "bVisible": true},       
  13.                 { "bVisible": true},       
  14.                 { "bVisible": true},       
  15.             ],
  16.            
  17.         });
  18.         // Highlighted rows
  19.         $("#table_export tbody input[type=checkbox]").each(function(i, el)
  20.         {
  21.             var $this = $(el),
  22.                 $p = $this.closest('tr');
  23.            
  24.             $(el).on('change', function()
  25.             {
  26.                 var is_checked = $this.is(':checked');
  27.                
  28.                 $p[is_checked ? 'addClass' : 'removeClass']('highlight');
  29.             });
  30.         });
  31.        
  32.         //customize the select menu
  33.         $(".dataTables_wrapper select").select2({
  34.             minimumResultsForSearch: -1
  35.         });
  36.        
  37.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement