View | Details | Raw Unified | Return to bug 33484
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc (-2 / +20 lines)
Lines 11-17 function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { Link Here
11
    var selector = '#' + id_selector;
11
    var selector = '#' + id_selector;
12
12
13
    if ( table_settings ) {
13
    if ( table_settings ) {
14
        var columns_settings = table_settings['columns'];
14
15
        var table_key =
16
          'DataTables_' +
17
          table_settings['module'] +'_' +
18
          table_settings['page'] +'_' +
19
          table_settings['table'];
20
21
        // enable stateSave
22
        dt_parameters['stateSave']         = true;
23
        dt_parameters['stateSaveCallback'] = function( settings, data ) {
24
            localStorage.setItem( table_key, JSON.stringify(data) )
25
        }
26
        dt_parameters['stateLoadCallback'] = function(settings) {
27
            return JSON.parse( localStorage.getItem(table_key) )
28
        }
29
30
        // merge stateSave for column settings
31
        var local_settings = localStorage.getItem(table_key);
32
        var system_settings = table_settings['columns'];
33
        var columns_settings = get_columns_saved_state(local_settings, system_settings);
15
34
16
        $(columns_settings).each( function() {
35
        $(columns_settings).each( function() {
17
            var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
36
            var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
18
- 

Return to bug 33484