diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
index 1dbf4758f0..11b3fc298d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
@@ -466,7 +466,7 @@
let item_search_selections = JSON.parse( localStorage.getItem("item_search_selections") ) || [];
if( item_search_selections.length > 0 ){
showItemSelections( item_search_selections.length );
- $("#results input[type='checkbox']").each(function(){
+ $("#item_search input[type='checkbox']").each(function(){
var itemnumber = $(this).val();
if( item_search_selections.indexOf( itemnumber ) >= 0 ){
$(this).prop("checked", true );
@@ -554,7 +554,7 @@
+ ' ' + _("Clear") + ''
+ ' '
+ ' '
- + '
'
+ + ' '
+ ' ' + tr + ''
+ ' '
+ '
'
@@ -664,7 +664,7 @@
};
var table_settings = [% TablesSettings.GetTableSettings( 'catalogue', 'itemsearch', 'results', 'json' ) | $raw %];
- $('#results').kohaTable( {
+ $('#item_search').kohaTable( {
"bKohaColumnsUseNames": true,
"destroy": true,
"serverSide": true,
@@ -719,7 +719,7 @@
fixedHeader: false // There is a bug on this view
}, table_settings, true, null, filters_options );
- $('#results').on('draw.dt', function (e, settings) {
+ $('#item_search').on('draw.dt', function (e, settings) {
prepSelections();
$('[data-bs-toggle="tooltip"]').tooltip();
});
@@ -767,7 +767,7 @@
$("body").on("click", "#select_all", function(e) {
e.preventDefault();
- $("#results input[type='checkbox']").each(function(){
+ $("#item_search input[type='checkbox']").each(function(){
if( $(this).prop("checked") == false ){
$(this).prop( "checked", true ).change();
}
@@ -776,7 +776,7 @@
$("body").on("click", "#clear_all", function(e) {
e.preventDefault();
- $("#results input[type='checkbox']").each(function(){
+ $("#item_search input[type='checkbox']").each(function(){
if( $(this).prop("checked") == true ){
$(this).prop( "checked", false ).change();
}
@@ -785,12 +785,12 @@
$("body").on("click", "#clear-row-selection", function(e){
e.preventDefault();
- $("#results input[type='checkbox']").prop("checked" ,false ).change();
+ $("#item_search input[type='checkbox']").prop("checked" ,false ).change();
localStorage.removeItem("item_search_selections");
showItemSelections( 0 );
});
- $("body").on('change', '#results input[type="checkbox"]', function() {
+ $("body").on('change', '#item_search input[type="checkbox"]', function() {
let item_search_selections = JSON.parse( localStorage.getItem("item_search_selections") ) || [];
var itemnumber = $(this).val();
if( $(this).prop("checked") ){
@@ -860,7 +860,7 @@
batch_mod_form.submit();
});
- $("body").on('click','#results tbody td',function(e){
+ $("body").on('click','#item_search tbody td',function(e){
var checkbox = $(this).find("input[type=checkbox]");
if (e.target.type != "checkbox") {
checkbox.prop('checked', !checkbox.prop("checked"));
diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js
index 3d10338618..b20813f4d9 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js
@@ -1034,10 +1034,15 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) {
return this._id !== "" && this._str !== "";
})
.each(function () {
- let optionValue =
- table_dt.settings()[0].ajax !== null
- ? `^${this._id}$`
- : this._id;
+ let optionValue = this._id;
+
+ if (
+ table_dt.settings()[0].ajax !== null &&
+ table_node.attr("id") !== "item_search"
+ ) {
+ optionValue = `^${this._id}$`;
+ }
+
let o = $(
``
);