1 [% USE ColumnsSettings %]
3 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/buttons.dataTables.min.css" />
4 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/dataTables.buttons.min.js"></script>
5 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/buttons.colVis.min.js"></script>
7 <script type="text/javascript">
8 function KohaTable(selector, dt_parameters, columns_settings) {
11 var included_ids = [];
12 $(columns_settings).each( function() {
13 var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' );
14 var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : id;
15 if ( used_id == -1 ) return;
17 if ( this['is_hidden'] == "1" ) {
18 hidden_ids.push( used_id );
20 if ( this['cannot_be_toggled'] == "0" ) {
21 included_ids.push( used_id );
25 dt_parameters[ "buttons" ] = [
28 columns: included_ids,
29 text: _('Column visibility'),
32 var table = $(selector).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters));
34 $(hidden_ids).each(function(index, value) {
35 table.fnSetColumnVis( value, false );