Move Overdues to Top of Checkout Table


Today’s guest post is from George Williams at VALNet:


I just posted some jQuery to the Koha wiki that moves overdue items to the top of the table when you’re checking things out to patrons and thought other ByWater partners would like to see it:

//BEGIN Move overdues to the top of the table

   $('#issues-table').on( 'init.dt', function () {

      $("#issues-table:has(.overdue)").attr('od','overduetable');

      if($("#issues-table").attr('od')) {

         $("#issues-table tbody").attr("class","checkoutbody");

         $('.checkoutbody tr:first').before('<tr id="overduetr"><td colspan="10" style="background-color:pink; font-size: x-large"><strong>Patron has overdue items</strong></td></tr>');

         $("#issues-table .overdue").parents("tr").insertAfter("#overduetr");

         };

      $("#issues-table th:first").off("click").removeClass();

   });

//END Move overdues to the top of the table

Before the code it looks like this:

Checkouts

And after:

Checkouts with JQuery

Leave a comment

Your email address will not be published. Required fields are marked *

Are you human? * Time limit is exhausted. Please reload CAPTCHA.