|
Lines 567-597
function footer_column_sum( api, column_numbers ) {
Link Here
|
| 567 |
$( api.column( column_number ).footer() ).html(total.format_price()); |
567 |
$( api.column( column_number ).footer() ).html(total.format_price()); |
| 568 |
}; |
568 |
}; |
| 569 |
} |
569 |
} |
| 570 |
|
|
|
| 571 |
/* get_columns_saved_state checks for a DataTables configuration saved |
| 572 |
* in the browser's local storage. If it is present, the columns |
| 573 |
* configuration supplied by Koha is overwritten |
| 574 |
* |
| 575 |
* It takes two parameters: |
| 576 |
* - localstorage_config, the DataTables saved state object from local storage |
| 577 |
* - columns_settings, the columns settings object supplied by the template |
| 578 |
*/ |
| 579 |
|
| 580 |
function get_columns_saved_state( localstorage_config, columns_settings ){ |
| 581 |
var tables = JSON.parse( localstorage_config ); |
| 582 |
// if a table configuration was found in local storage, parse it |
| 583 |
if( tables ){ |
| 584 |
var stateSave_column_visibility = []; |
| 585 |
$(tables.columns).each(function(){ |
| 586 |
stateSave_column_visibility.push( this.visible === true ? 0 : 1 ); |
| 587 |
}); |
| 588 |
$.each( columns_settings, function( index, key ){ |
| 589 |
if( stateSave_column_visibility[ index ] !== columns_settings[key] ){ |
| 590 |
columns_settings[ index ].is_hidden = stateSave_column_visibility[ index ]; |
| 591 |
} |
| 592 |
}); |
| 593 |
return columns_settings; |
| 594 |
} else { |
| 595 |
return columns_settings; |
| 596 |
} |
| 597 |
} |
| 598 |
- |