Bug 10212: Move colvis files to the include file
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / columns_settings.inc
1 [% USE ColumnsSettings %]
2
3 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.colvis.css" />
4 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.colvis.js"></script>
5
6 <script type="text/javascript">
7 function KohaTable(selector, dt_parameters, columns_settings) {
8     var id = 0;
9     var hidden_ids = [];
10     var excluded_ids = [];
11     $(columns_settings).each( function() {
12         if ( this['is_hidden'] == "1" ) {
13             hidden_ids.push( id );
14         }
15         if ( this['cannot_be_toggled'] == "1" ) {
16             excluded_ids.push( id );
17         }
18         id++;
19     });
20     dt_parameters[ "oColVis" ] = { "aiExclude": excluded_ids };
21     var table = $(selector).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters));
22
23     $(hidden_ids).each(function(index, value) {
24         table.fnSetColumnVis( value, false );
25     });
26
27     return table;
28 }
29
30 </script>