Lines 523-535
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
523 |
* We extend the options set with the `criteria` key which allows |
523 |
* We extend the options set with the `criteria` key which allows |
524 |
* the developer to select the match type to be applied during searches |
524 |
* the developer to select the match type to be applied during searches |
525 |
* Valid keys are: `contains`, `starts_with`, `ends_with` and `exact` |
525 |
* Valid keys are: `contains`, `starts_with`, `ends_with` and `exact` |
526 |
* @param {Object} column_settings The arrayref as returned by TableSettings.GetColums function available |
526 |
* @param {Object} table_settings The arrayref as returned by TableSettings.GetTableSettings function available |
527 |
* from the columns_settings template toolkit include |
527 |
* from the columns_settings template toolkit include |
528 |
* @param {Boolean} add_filters Add a filters row as the top row of the table |
528 |
* @param {Boolean} add_filters Add a filters row as the top row of the table |
529 |
* @param {Object} default_filters Add a set of default search filters to apply at table initialisation |
529 |
* @param {Object} default_filters Add a set of default search filters to apply at table initialisation |
530 |
* @return {Object} The dataTables instance |
530 |
* @return {Object} The dataTables instance |
531 |
*/ |
531 |
*/ |
532 |
$.fn.kohaTable = function(options, columns_settings, add_filters, default_filters) { |
532 |
$.fn.kohaTable = function(options, table_settings, add_filters, default_filters) { |
533 |
var settings = null; |
533 |
var settings = null; |
534 |
|
534 |
|
535 |
if ( add_filters ) { |
535 |
if ( add_filters ) { |
Lines 667-685
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
667 |
var hidden_ids = []; |
667 |
var hidden_ids = []; |
668 |
var included_ids = []; |
668 |
var included_ids = []; |
669 |
|
669 |
|
670 |
$(columns_settings).each( function() { |
|
|
671 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', this ).index( 'th' ); |
672 |
var used_id = settings.bKohaColumnsUseNames ? named_id : counter; |
673 |
if ( used_id == -1 ) return; |
674 |
|
670 |
|
675 |
if ( this['is_hidden'] == "1" ) { |
671 |
if ( table_settings ) { |
676 |
hidden_ids.push( used_id ); |
672 |
var columns_settings = table_settings['columns']; |
677 |
} |
673 |
$(columns_settings).each( function() { |
678 |
if ( this['cannot_be_toggled'] == "0" ) { |
674 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', this ).index( 'th' ); |
679 |
included_ids.push( used_id ); |
675 |
var used_id = settings.bKohaColumnsUseNames ? named_id : counter; |
680 |
} |
676 |
if ( used_id == -1 ) return; |
681 |
counter++; |
677 |
|
682 |
}); |
678 |
if ( this['is_hidden'] == "1" ) { |
|
|
679 |
hidden_ids.push( used_id ); |
680 |
} |
681 |
if ( this['cannot_be_toggled'] == "0" ) { |
682 |
included_ids.push( used_id ); |
683 |
} |
684 |
counter++; |
685 |
}); |
686 |
} |
683 |
|
687 |
|
684 |
var exportColumns = ":visible:not(.noExport)"; |
688 |
var exportColumns = ":visible:not(.noExport)"; |
685 |
if( settings.hasOwnProperty("exportColumns") ){ |
689 |
if( settings.hasOwnProperty("exportColumns") ){ |
Lines 783-788
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
783 |
settings['orderCellsTop'] = true; |
787 |
settings['orderCellsTop'] = true; |
784 |
} |
788 |
} |
785 |
|
789 |
|
|
|
790 |
if ( table_settings ) { |
791 |
if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) { |
792 |
settings["pageLength"] = table_settings['default_display_length']; |
793 |
} |
794 |
if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) { |
795 |
settings["order"] = [[ table_settings['default_sort_order'], 'asc' ]]; |
796 |
} |
797 |
} |
798 |
|
786 |
var table = $(this).dataTable(settings); |
799 |
var table = $(this).dataTable(settings); |
787 |
|
800 |
|
788 |
table.DataTable().on("column-visibility.dt", function(){ |
801 |
table.DataTable().on("column-visibility.dt", function(){ |
789 |
- |
|
|