Lines 9-29
function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
Link Here
|
9 |
var included_ids = []; |
9 |
var included_ids = []; |
10 |
var selector = '#' + id_selector; |
10 |
var selector = '#' + id_selector; |
11 |
|
11 |
|
12 |
var columns_settings = table_settings['columns']; |
12 |
if ( table_settings ) { |
|
|
13 |
var columns_settings = table_settings['columns']; |
13 |
|
14 |
|
14 |
$(columns_settings).each( function() { |
15 |
$(columns_settings).each( function() { |
15 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' ); |
16 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' ); |
16 |
var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter; |
17 |
var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter; |
17 |
if ( used_id == -1 ) return; |
18 |
if ( used_id == -1 ) return; |
18 |
|
19 |
|
19 |
if ( this['is_hidden'] == "1" ) { |
20 |
if ( this['is_hidden'] == "1" ) { |
20 |
hidden_ids.push( used_id ); |
21 |
hidden_ids.push( used_id ); |
21 |
} |
22 |
} |
22 |
if ( this['cannot_be_toggled'] == "0" ) { |
23 |
if ( this['cannot_be_toggled'] == "0" ) { |
23 |
included_ids.push( used_id ); |
24 |
included_ids.push( used_id ); |
24 |
} |
25 |
} |
25 |
counter++; |
26 |
counter++; |
26 |
}); |
27 |
}); |
|
|
28 |
} |
27 |
|
29 |
|
28 |
var exportColumns = ":visible:not(.noExport)"; |
30 |
var exportColumns = ":visible:not(.noExport)"; |
29 |
var exportRows = ":visible:not(.noExport)"; |
31 |
var exportRows = ":visible:not(.noExport)"; |
Lines 184-194
function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
Link Here
|
184 |
}); |
186 |
}); |
185 |
} |
187 |
} |
186 |
|
188 |
|
187 |
if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) { |
189 |
if ( table_settings ) { |
188 |
new_parameters["pageLength"] = table_settings['default_display_length']; |
190 |
if ( table_settings.hasOwnProperty('default_display_length') && table_settings['default_display_length'] != null ) { |
189 |
} |
191 |
new_parameters["pageLength"] = table_settings['default_display_length']; |
190 |
if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) { |
192 |
} |
191 |
new_parameters["order"] = [[ table_settings['default_sort_order'], 'asc' ]]; |
193 |
if ( table_settings.hasOwnProperty('default_sort_order') && table_settings['default_sort_order'] != null ) { |
|
|
194 |
new_parameters["order"] = [[ table_settings['default_sort_order'], 'asc' ]]; |
195 |
} |
192 |
} |
196 |
} |
193 |
|
197 |
|
194 |
table.dataTable(new_parameters); |
198 |
table.dataTable(new_parameters); |