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

I am using the DataTables Buttons for Print and CSV - how can I suppress a column

$
0
0

My DataTables view contains a column with a user-interface feature (checkbox to select a row) but I'd like this column to be suppressed in a Print or Export-to-csv view.

I've tried code like this: ''' dataTables_searchResults.columns( '.nonPrintingColumn' ).visible( false );

dataTables_searchResults.buttons.exportData( {
        columns: ':visible'
    });

dataTables_searchResults.columns.adjust().draw( false );

and like this: ''' var columnObj = dataTables_searchResults.column (7);

 columnObj.visible (false, true);

and then triggering the print function:

''' $('#dataTables-buttons-holding-div div.dt-buttons a.buttons-print').click();

In some cases the column gets hidden on-screen; but it never gets hidden in the Print view or the CSV view

Here's my DataTables debug bookmarklet code: izavej


Viewing all articles
Browse latest Browse all 82624

Latest Images

Trending Articles



Latest Images

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