|
Lines 869-887
Link Here
|
| 869 |
$("#[% table_id | html %]_search_results").show(); |
869 |
$("#[% table_id | html %]_search_results").show(); |
| 870 |
|
870 |
|
| 871 |
let table_dt = patrons_table.DataTable(); |
871 |
let table_dt = patrons_table.DataTable(); |
| 872 |
[% FOR c IN columns %] |
872 |
let loaded_from_state = table_dt.settings()[0].loaded_from_state; |
| 873 |
[% SWITCH c %] |
873 |
if ( !loaded_from_state ) { |
| 874 |
[% CASE 'branch' %] |
874 |
[% FOR c IN columns %] |
| 875 |
let library_id = patron_search_form.find(".branchcode_filter").val() || ""; |
875 |
[% SWITCH c %] |
| 876 |
patrons_table.find('thead tr:eq(1) th[data-filter="libraries"] select').val(library_id); |
876 |
[% CASE 'branch' %] |
| 877 |
table_dt.column([% loop.count - 1 %]).search(library_id ? '^'+library_id+'$' : ''); |
877 |
let library_id = patron_search_form.find(".branchcode_filter").val() || ""; |
| 878 |
[% CASE 'category' %] |
878 |
patrons_table.find('thead tr:eq(1) th[data-filter="libraries"] select').val(library_id); |
| 879 |
let category_id = patron_search_form.find(".categorycode_filter").val() || ""; |
879 |
table_dt.column([% loop.count - 1 %]).search(library_id ? '^'+library_id+'$' : ''); |
| 880 |
patrons_table.find('thead tr:eq(1) th[data-filter="categories"] select').val(category_id.toLowerCase()); |
880 |
[% CASE 'category' %] |
| 881 |
table_dt.column([% loop.count - 1 %]).search(category_id ? '^'+category_id+'$' : ''); |
881 |
let category_id = patron_search_form.find(".categorycode_filter").val() || ""; |
|
|
882 |
patrons_table.find('thead tr:eq(1) th[data-filter="categories"] select').val(category_id.toLowerCase()); |
| 883 |
table_dt.column([% loop.count - 1 %]).search(category_id ? '^'+category_id+'$' : ''); |
| 884 |
[% END %] |
| 882 |
[% END %] |
885 |
[% END %] |
| 883 |
[% END %] |
886 |
table_dt.search(""); |
| 884 |
table_dt.search(""); |
887 |
} |
| 885 |
first_draw = 1; // Only redirect if we are coming from here |
888 |
first_draw = 1; // Only redirect if we are coming from here |
| 886 |
table_dt.draw(); |
889 |
table_dt.draw(); |
| 887 |
[% IF display_search_description %] |
890 |
[% IF display_search_description %] |