|
Lines 8-28
function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
Link Here
|
| 8 |
var included_ids = []; |
8 |
var included_ids = []; |
| 9 |
var selector = '#' + id_selector; |
9 |
var selector = '#' + id_selector; |
| 10 |
|
10 |
|
| 11 |
var columns_settings = table_settings['columns']; |
11 |
if ( table_settings ) { |
|
|
12 |
var columns_settings = table_settings['columns']; |
| 12 |
|
13 |
|
| 13 |
$(columns_settings).each( function() { |
14 |
$(columns_settings).each( function() { |
| 14 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' ); |
15 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' ); |
| 15 |
var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter; |
16 |
var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter; |
| 16 |
if ( used_id == -1 ) return; |
17 |
if ( used_id == -1 ) return; |
| 17 |
|
18 |
|
| 18 |
if ( this['is_hidden'] == "1" ) { |
19 |
if ( this['is_hidden'] == "1" ) { |
| 19 |
hidden_ids.push( used_id ); |
20 |
hidden_ids.push( used_id ); |
| 20 |
} |
21 |
} |
| 21 |
if ( this['cannot_be_toggled'] == "0" ) { |
22 |
if ( this['cannot_be_toggled'] == "0" ) { |
| 22 |
included_ids.push( used_id ); |
23 |
included_ids.push( used_id ); |
| 23 |
} |
24 |
} |
| 24 |
counter++; |
25 |
counter++; |
| 25 |
}); |
26 |
}); |
|
|
27 |
} |
| 26 |
|
28 |
|
| 27 |
var exportColumns = ":visible:not(.noExport)"; |
29 |
var exportColumns = ":visible:not(.noExport)"; |
| 28 |
if( dt_parameters.hasOwnProperty("exportColumns") ){ |
30 |
if( dt_parameters.hasOwnProperty("exportColumns") ){ |
|
Lines 146-156
function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
Link Here
|
| 146 |
}); |
148 |
}); |
| 147 |
} |
149 |
} |
| 148 |
|
150 |
|
| 149 |
if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) { |
151 |
if ( table_settings ) { |
| 150 |
new_parameters["pageLength"] = table_settings['default_display_length']; |
152 |
if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) { |
| 151 |
} |
153 |
new_parameters["pageLength"] = table_settings['default_display_length']; |
| 152 |
if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) { |
154 |
} |
| 153 |
new_parameters["order"] = [[ table_settings['default_sort_order'], 'asc' ]]; |
155 |
if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) { |
|
|
156 |
new_parameters["order"] = [[ table_settings['default_sort_order'], 'asc' ]]; |
| 157 |
} |
| 154 |
} |
158 |
} |
| 155 |
|
159 |
|
| 156 |
table.dataTable(new_parameters); |
160 |
table.dataTable(new_parameters); |