Bugzilla – Attachment 173415 Details for
Bug 37238
Add table settings to itemsearch results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37238: Replace jquery.dataTables.columnFilter.js with native DataTables function
Bug-37238-Replace-jquerydataTablescolumnFilterjs-w.patch (text/plain), 2.26 KB, created by
Lucas Gass (lukeg)
on 2024-10-25 22:47:09 UTC
(
hide
)
Description:
Bug 37238: Replace jquery.dataTables.columnFilter.js with native DataTables function
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-10-25 22:47:09 UTC
Size:
2.26 KB
patch
obsolete
>From 6278d946be7a04e3c8e510c74fbd37be52d58b51 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 3 Jul 2024 22:24:03 +0000 >Subject: [PATCH] Bug 37238: Replace jquery.dataTables.columnFilter.js with > native DataTables function > >--- > .../prog/en/modules/catalogue/itemsearch.tt | 21 ++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >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 624e1678536..4e18d6e8827 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -517,7 +517,8 @@ > + ' </div>' > + ' </div>' > + ' <table id="results">' >- + ' <thead>' + tr + tr + '</thead>' >+ + ' <thead>' + tr + '</thead>' >+ + ' <tfoot>' + tr + '</tfoot>' > + ' <tbody></tbody>' > + ' </table>' > + '</div>'; >@@ -619,6 +620,24 @@ > "drawCallback": function( settings ) { > prepSelections(); > }, >+ "initComplete": function() { >+ $('#results').DataTable().columns().every(function () { >+ let column = this; >+ let columnName = $(column.footer()).data('colname'); >+ let title = column.footer().textContent; >+ >+ let input = document.createElement('input'); >+ input.classList.add('text_filter', 'form-control' , 'search_init'); >+ input.placeholder = title; >+ column.footer().replaceChildren(input); >+ >+ input.addEventListener('keyup', () => { >+ if (column.search() !== this.value) { >+ column.search(input.value).draw(); >+ } >+ }); >+ }); >+ }, > fixedHeader: false // There is a bug on this view > }, table_settings ).columnFilter({ > 'sPlaceHolder': 'head:after', >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37238
:
168409
|
168411
|
168483
|
170785
|
171037
|
173414
|
173415
|
173416
|
173740
|
173765
|
173766
|
173768
|
173785
|
173786
|
173787