schemaSpy.js (1622B)
1 $(function() { 2 var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/")+1); 3 $("#navbar-collapse ul li a").each(function(){ 4 if($(this).attr("href") == pgurl || $(this).attr("href") == '' ) 5 $(this).parent().addClass("active"); 6 }) 7 }); 8 9 function dataTableExportButtons(table) { 10 $("<div class=\"row\">\n" + 11 " <div id=\"button_group_one\" class=\"col-md-6 col-sm-6\"></div>\n" + 12 " <div id=\"button_group_two\" class=\"col-md-2 col-sm-4 pull-right text-right\"></div>\n" + 13 "</div>").prependTo('#' + table.table().container().id); 14 new $.fn.dataTable.Buttons( table, { 15 name: 'exports', 16 buttons: [ 17 { 18 extend: 'copyHtml5', 19 text: '<i class="fa fa-files-o"></i>', 20 titleAttr: 'Copy' 21 }, 22 { 23 extend: 'excelHtml5', 24 text: '<i class="fa fa-file-excel-o"></i>', 25 titleAttr: 'Excel' 26 }, 27 { 28 extend: 'csvHtml5', 29 text: '<i class="fa fa-file-text-o"></i>', 30 titleAttr: 'CSV' 31 }, 32 { 33 extend: 'pdfHtml5', 34 text: '<i class="fa fa-file-pdf-o"></i>', 35 orientation: 'landscape', 36 titleAttr: 'PDF' 37 } 38 ] 39 } ); 40 41 table.buttons().container().appendTo( '#' + table.table().container().id + ' #button_group_one' ); 42 table.buttons( 'exports', null ).container().appendTo( '#' + table.table().container().id + ' #button_group_two' ); 43 } 44 45