Lines 496-508
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
496 |
* We extend the options set with the `criteria` key which allows |
496 |
* We extend the options set with the `criteria` key which allows |
497 |
* the developer to select the match type to be applied during searches |
497 |
* the developer to select the match type to be applied during searches |
498 |
* Valid keys are: `contains`, `starts_with`, `ends_with` and `exact` |
498 |
* Valid keys are: `contains`, `starts_with`, `ends_with` and `exact` |
499 |
* @param {Object} column_settings The arrayref as returned by TableSettings.GetColums function available |
499 |
* @param {Object} table_settings The arrayref as returned by TableSettings.GetTableSettings function available |
500 |
* from the columns_settings template toolkit include |
500 |
* from the columns_settings template toolkit include |
501 |
* @param {Boolean} add_filters Add a filters row as the top row of the table |
501 |
* @param {Boolean} add_filters Add a filters row as the top row of the table |
502 |
* @param {Object} default_filters Add a set of default search filters to apply at table initialisation |
502 |
* @param {Object} default_filters Add a set of default search filters to apply at table initialisation |
503 |
* @return {Object} The dataTables instance |
503 |
* @return {Object} The dataTables instance |
504 |
*/ |
504 |
*/ |
505 |
$.fn.kohaTable = function(options, columns_settings, add_filters, default_filters) { |
505 |
$.fn.kohaTable = function(options, table_settings, add_filters, default_filters) { |
506 |
var settings = null; |
506 |
var settings = null; |
507 |
|
507 |
|
508 |
if ( add_filters ) { |
508 |
if ( add_filters ) { |
Lines 683-701
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
683 |
var hidden_ids = []; |
683 |
var hidden_ids = []; |
684 |
var included_ids = []; |
684 |
var included_ids = []; |
685 |
|
685 |
|
686 |
$(columns_settings).each( function() { |
|
|
687 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', this ).index( 'th' ); |
688 |
var used_id = settings.bKohaColumnsUseNames ? named_id : counter; |
689 |
if ( used_id == -1 ) return; |
690 |
|
686 |
|
691 |
if ( this['is_hidden'] == "1" ) { |
687 |
if ( table_settings ) { |
692 |
hidden_ids.push( used_id ); |
688 |
var columns_settings = table_settings['columns']; |
693 |
} |
689 |
$(columns_settings).each( function() { |
694 |
if ( this['cannot_be_toggled'] == "0" ) { |
690 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', this ).index( 'th' ); |
695 |
included_ids.push( used_id ); |
691 |
var used_id = settings.bKohaColumnsUseNames ? named_id : counter; |
696 |
} |
692 |
if ( used_id == -1 ) return; |
697 |
counter++; |
693 |
|
698 |
}); |
694 |
if ( this['is_hidden'] == "1" ) { |
|
|
695 |
hidden_ids.push( used_id ); |
696 |
} |
697 |
if ( this['cannot_be_toggled'] == "0" ) { |
698 |
included_ids.push( used_id ); |
699 |
} |
700 |
counter++; |
701 |
}); |
702 |
} |
699 |
|
703 |
|
700 |
var exportColumns = ":visible:not(.noExport)"; |
704 |
var exportColumns = ":visible:not(.noExport)"; |
701 |
if( settings.hasOwnProperty("exportColumns") ){ |
705 |
if( settings.hasOwnProperty("exportColumns") ){ |
Lines 799-804
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
799 |
settings['orderCellsTop'] = true; |
803 |
settings['orderCellsTop'] = true; |
800 |
} |
804 |
} |
801 |
|
805 |
|
|
|
806 |
if ( table_settings ) { |
807 |
if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) { |
808 |
settings["pageLength"] = table_settings['default_display_length']; |
809 |
} |
810 |
if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) { |
811 |
settings["order"] = [[ table_settings['default_sort_order'], 'asc' ]]; |
812 |
} |
813 |
} |
814 |
|
802 |
var table = $(this).dataTable(settings); |
815 |
var table = $(this).dataTable(settings); |
803 |
|
816 |
|
804 |
|
817 |
|
805 |
- |
|
|