Bug 34871 - Highlight scanned item in holdings table when searching
Summary: Highlight scanned item in holdings table when searching
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-21 20:23 UTC by Andrew Fuerste-Henry
Modified: 2023-09-21 20:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2023-09-21 20:23:32 UTC
When one has an item in-hand and scans the barcode into search to find the bib record, it can be hard to find the specific item scanned within the holdings table.
Comment 1 Andrew Fuerste-Henry 2023-09-21 20:24:28 UTC
We're currently accomplishing this with the following jquery:
$(document).ready(function () {
    if ( $('#catalog_detail').length && window.location.href.indexOf("found1=1") > -1 ) {
        setTimeout(function() {
          let search_value = $('#search-form').val().trim(); 
          let barcode_index = $('th:contains("Barcode")').index() +1; //add one for nth-child
          $('#holdings_table tbody tr td:nth-child('+barcode_index+')').each( function() {
          	if ( $(this).text() === search_value ) {
            	$(this).parent().addClass('found_bc');
                $(this).parent().children('td').css('background' , 'khaki');
            }
          })
          //now clear the search form
          if ( $('#cat-search-block').length ) {
            $('#search-form').val('');
            localStorage.setItem('searchbox_value', '');
            $('#search-form').focus();
          }
        }, 100);
    }
});