"Fossies" - the Fresh Open Source Software Archive

Member "koha-19.11.15/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc" (23 Feb 2021, 1052 Bytes) of package /linux/misc/koha-19.11.15.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) fasm source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "columns_settings.inc" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 20.05.06_vs_20.11.00.

    1 [% USE ColumnsSettings %]
    2 
    3 <script>
    4 function KohaTable(selector, dt_parameters, columns_settings) {
    5     var id = 0;
    6     var hidden_ids = [];
    7     var included_ids = [];
    8     $(columns_settings).each( function() {
    9         var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector+' th' );
   10 
   11         var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : id;
   12         if ( used_id == -1 ) return;
   13 
   14         if ( this['is_hidden'] == "1" ) {
   15             hidden_ids.push( used_id );
   16         }
   17         if ( this['cannot_be_toggled'] == "0" ) {
   18             included_ids.push( used_id );
   19         }
   20         id++;
   21     });
   22     dt_parameters[ "buttons" ] = [
   23         {
   24             extend: 'colvis',
   25             columns: included_ids,
   26             text: _("Column visibility"),
   27         }
   28     ];
   29     var table = $(selector).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters));
   30 
   31     $(hidden_ids).each(function(index, value) {
   32         table.fnSetColumnVis( value, false );
   33     });
   34 
   35     return table;
   36 }
   37 
   38 </script>