Lines 21-26
function disableGrouping(datatable) {
Link Here
|
21 |
} |
21 |
} |
22 |
} |
22 |
} |
23 |
|
23 |
|
|
|
24 |
function enableFiltering(datatable) { |
25 |
var oSettings = datatable.fnSettings(); |
26 |
var filters_row = $(oSettings.nTable).find('thead tr.filters_row'); |
27 |
if (!filters_row.hasClass('columnFilter')) { |
28 |
datatable.columnFilter({ |
29 |
sPlaceHolder: "head:after", |
30 |
bUseColVis: true, |
31 |
sRangeFormat: "From {from}<br>to {to}", |
32 |
aoColumns: [ |
33 |
null, |
34 |
null, |
35 |
null, |
36 |
null, |
37 |
{ type: "date-range" }, |
38 |
{ type: "text" }, |
39 |
{ type: "text" }, |
40 |
{ type: "text" }, |
41 |
{ type: "date-range" }, |
42 |
{ type: "text" }, |
43 |
{ type: "text" }, |
44 |
null, |
45 |
null, |
46 |
null, |
47 |
null, |
48 |
null, |
49 |
null, |
50 |
null |
51 |
] |
52 |
}); |
53 |
filters_row.addClass('columnFilter'); |
54 |
} |
55 |
filters_row.show(); |
56 |
} |
57 |
|
58 |
function disableFiltering(datatable) { |
59 |
var oSettings = datatable.fnSettings(); |
60 |
var filters_row = $(oSettings.nTable).find('thead tr.filters_row'); |
61 |
filters_row.find('input[type="text"]') |
62 |
.val('') // Empty filter text boxes |
63 |
.trigger('keyup') // Filter (display all rows) |
64 |
.trigger('blur'); // Reset value to the column name |
65 |
filters_row.hide(); |
66 |
} |
67 |
|
24 |
function loadTableData(datatable, borrowernumbers, offset, count) { |
68 |
function loadTableData(datatable, borrowernumbers, offset, count) { |
25 |
offset = offset ? offset : 0; |
69 |
offset = offset ? offset : 0; |
26 |
count = count ? count : 100; |
70 |
count = count ? count : 100; |
Lines 522-527
$(document).ready(function() {
Link Here
|
522 |
.append('<label for="issues-table-row-grouping-switch">' + GROUP_TODAYS_CHECKOUTS + '</label>') |
566 |
.append('<label for="issues-table-row-grouping-switch">' + GROUP_TODAYS_CHECKOUTS + '</label>') |
523 |
.appendTo('#issues-table_wrapper .top.pager'); |
567 |
.appendTo('#issues-table_wrapper .top.pager'); |
524 |
|
568 |
|
|
|
569 |
var filteringSwitch = $('<input type="checkbox">') |
570 |
.attr('id', 'issues-table-filtering-switch') |
571 |
.css('vertical-align', 'middle') |
572 |
.change(function() { |
573 |
if ($(this).is(':checked')) { |
574 |
enableFiltering(issuesTable); |
575 |
} else { |
576 |
disableFiltering(issuesTable); |
577 |
} |
578 |
}); |
579 |
$('<div></div>') |
580 |
.css('float', 'left') |
581 |
.css('padding', '0.3em 0.5em') |
582 |
.css('line-height', '1.9em') |
583 |
.append(filteringSwitch) |
584 |
.append(' ') |
585 |
.append('<label for="issues-table-filtering-switch">' + SHOW_COLUMN_FILTERS + '</label>') |
586 |
.appendTo('#issues-table_wrapper .top.pager'); |
587 |
|
525 |
loadTableData(issuesTable, borrowernumber); |
588 |
loadTableData(issuesTable, borrowernumber); |
526 |
|
589 |
|
527 |
if ( $("#issues-table").length ) { |
590 |
if ( $("#issues-table").length ) { |