Lines 288-294
Link Here
|
288 |
[% MACRO jsinclude BLOCK %] |
288 |
[% MACRO jsinclude BLOCK %] |
289 |
[% INCLUDE 'datatables.inc' %] |
289 |
[% INCLUDE 'datatables.inc' %] |
290 |
[% INCLUDE 'columns_settings.inc' %] |
290 |
[% INCLUDE 'columns_settings.inc' %] |
291 |
[% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] |
|
|
292 |
[% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %] |
291 |
[% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %] |
293 |
[% INCLUDE 'select2.inc' %] |
292 |
[% INCLUDE 'select2.inc' %] |
294 |
<script> |
293 |
<script> |
Lines 435-441
Link Here
|
435 |
+ ' </div>' |
434 |
+ ' </div>' |
436 |
+ ' </div>' |
435 |
+ ' </div>' |
437 |
+ ' <table id="results">' |
436 |
+ ' <table id="results">' |
438 |
+ ' <thead>' + tr + tr + '</thead>' |
437 |
+ ' <thead>' + tr + '</thead>' |
|
|
438 |
+ ' <tfoot>' + tr + '</tfoot>' |
439 |
+ ' <tbody></tbody>' |
439 |
+ ' <tbody></tbody>' |
440 |
+ ' </table>' |
440 |
+ ' </table>' |
441 |
+ '</div>'; |
441 |
+ '</div>'; |
Lines 526-595
Link Here
|
526 |
"drawCallback": function( settings ) { |
526 |
"drawCallback": function( settings ) { |
527 |
prepSelections(); |
527 |
prepSelections(); |
528 |
}, |
528 |
}, |
|
|
529 |
"initComplete": function() { |
530 |
$('#results').DataTable().columns().every(function () { |
531 |
let column = this; |
532 |
let columnName = $(column.footer()).data('colname'); |
533 |
let title = column.footer().textContent; |
534 |
|
535 |
let input = document.createElement('input'); |
536 |
input.classList.add('text_filter', 'form-control' , 'search_init'); |
537 |
input.placeholder = title; |
538 |
column.footer().replaceChildren(input); |
539 |
|
540 |
input.addEventListener('keyup', () => { |
541 |
if (column.search() !== this.value) { |
542 |
column.search(input.value).draw(); |
543 |
} |
544 |
}); |
545 |
}); |
546 |
}, |
529 |
fixedHeader: false // There is a bug on this view |
547 |
fixedHeader: false // There is a bug on this view |
530 |
}, table_settings ).columnFilter({ |
548 |
}, table_settings ); |
531 |
'sPlaceHolder': 'head:after', |
|
|
532 |
"columns": [ |
533 |
null, |
534 |
{ 'type': 'text' }, |
535 |
{ 'type': 'text' }, |
536 |
{ 'type': 'text' }, |
537 |
[% IF ccodes.size %] |
538 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => ccodes %] }, |
539 |
[% ELSE %] |
540 |
null, |
541 |
[% END %] |
542 |
{ 'type': 'text' }, |
543 |
{ 'type': 'text' }, |
544 |
{ 'type': 'text' }, |
545 |
{ 'type': 'text' }, |
546 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => branches %] }, |
547 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => branches %] }, |
548 |
[% IF locations.size %] |
549 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => locations %] }, |
550 |
[% ELSE %] |
551 |
null, |
552 |
[% END %] |
553 |
[% IF itemtypes.size %] |
554 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => itemtypes %] }, |
555 |
[% ELSE %] |
556 |
null, |
557 |
[% END %] |
558 |
{ 'type': 'text' }, |
559 |
[% IF notforloans.size %] |
560 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => notforloans %] }, |
561 |
[% ELSE %] |
562 |
null, |
563 |
[% END %] |
564 |
[% IF itemlosts.size %] |
565 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => itemlosts %] }, |
566 |
[% ELSE %] |
567 |
null, |
568 |
[% END %] |
569 |
[% IF withdrawns.size %] |
570 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => withdrawns %] }, |
571 |
[% ELSE %] |
572 |
null, |
573 |
[% END %] |
574 |
[% IF damageds.size %] |
575 |
{ 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => damageds %] }, |
576 |
[% ELSE %] |
577 |
null, |
578 |
[% END %] |
579 |
{ 'type': 'text' }, |
580 |
{ 'type': 'text' }, |
581 |
{ 'type': 'text' }, |
582 |
null |
583 |
] |
584 |
}); |
585 |
$('#results').on('draw.dt', function (e, settings) { |
586 |
prepSelections(); |
587 |
var Sticky = $("#searchheader"); |
588 |
Sticky.hcSticky({ |
589 |
stickTo: "#results-wrapper .page-section", |
590 |
stickyClass: "floating" |
591 |
}); |
592 |
}); |
593 |
} |
549 |
} |
594 |
|
550 |
|
595 |
$(document).ready(function () { |
551 |
$(document).ready(function () { |
596 |
- |
|
|