Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81989

Header row is not printing using print button ?

$
0
0

Hi I am using print button with header row column search. my code is working good but header row not going in print it is not going in pdf too. This is the example jsfiddle link

here is my js code ( Please Help me to find out where i did mistake)

$(document).ready( function () { // Setup - add a text input to each footer cell $('#ContentPlaceHolder1_GridView1 thead tr').clone(true).appendTo( '#ContentPlaceHolder1_GridView1 thead' ); $('#ContentPlaceHolder1_GridView1 thead tr:eq(1) th').each( function (i) { var title = $(this).text(); $(this).html( '' ); $( 'input', this ).on( 'keyup change', function () { if ( table.column(i).search() !== this.value ) { table .column(i) .search( this.value ) .draw(); } } ); } ); var table = $('#ContentPlaceHolder1_GridView1').DataTable({ dom: 'Bfrtip', buttons: [ { extend: 'print', title: '', customize: function ( win ) { $(win.document.body) .css( 'font-size', '10pt' ) .prepend( document.getElementById('ContentPlaceHolder1_lblCompanyNameHeader').innerText + '
Placement Register
' ); $(win.document.body).find( 'table' ) .addClass( 'compact' ) .css( 'font-size', 'inherit' ); } }, 'excelHtml5', 'csvHtml5', 'pdfHtml5' ], "paging": false } );} );

Viewing all articles
Browse latest Browse all 81989

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>