Lines 2-13
Link Here
|
2 |
|
2 |
|
3 |
<script type="text/javascript"> |
3 |
<script type="text/javascript"> |
4 |
function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { |
4 |
function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { |
5 |
var id = 0; |
5 |
var counter = 0; |
6 |
var hidden_ids = []; |
6 |
var hidden_ids = []; |
7 |
var included_ids = []; |
7 |
var included_ids = []; |
|
|
8 |
var selector = '#' + id_selector; |
9 |
|
8 |
$(columns_settings).each( function() { |
10 |
$(columns_settings).each( function() { |
9 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' ); |
11 |
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' ); |
10 |
var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : id; |
12 |
var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter; |
11 |
if ( used_id == -1 ) return; |
13 |
if ( used_id == -1 ) return; |
12 |
|
14 |
|
13 |
if ( this['is_hidden'] == "1" ) { |
15 |
if ( this['is_hidden'] == "1" ) { |
Lines 16-22
function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
Link Here
|
16 |
if ( this['cannot_be_toggled'] == "0" ) { |
18 |
if ( this['cannot_be_toggled'] == "0" ) { |
17 |
included_ids.push( used_id ); |
19 |
included_ids.push( used_id ); |
18 |
} |
20 |
} |
19 |
id++; |
21 |
counter++; |
20 |
}); |
22 |
}); |
21 |
dt_parameters[ "buttons" ] = [ |
23 |
dt_parameters[ "buttons" ] = [ |
22 |
{ |
24 |
{ |
Lines 26-32
function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
Link Here
|
26 |
} |
28 |
} |
27 |
]; |
29 |
]; |
28 |
|
30 |
|
29 |
var table = $('#' + id_selector + ' table'); |
31 |
var table = $(selector); |
30 |
if ( add_filters ) { |
32 |
if ( add_filters ) { |
31 |
// Duplicate the table header row for columnFilter |
33 |
// Duplicate the table header row for columnFilter |
32 |
thead_row = table.find('thead tr'); |
34 |
thead_row = table.find('thead tr'); |
Lines 46-52
function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
Link Here
|
46 |
link = $('<a>') |
48 |
link = $('<a>') |
47 |
.attr('href', '#') |
49 |
.attr('href', '#') |
48 |
.attr('id', id_selector + '_activate_filters'); |
50 |
.attr('id', id_selector + '_activate_filters'); |
49 |
$("." + id_selector + "_table_controls").prepend(link); |
51 |
$("." + id_selector + "_table_controls").prepend(link); |
50 |
deactivate_filters(id_selector); |
52 |
deactivate_filters(id_selector); |
51 |
} |
53 |
} |
52 |
|
54 |
|