Bugzilla – Attachment 176560 Details for
Bug 38255
Do not use dataTable constructor directly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38255: Fix Cash registers
Bug-38255-Fix-Cash-registers.patch (text/plain), 2.32 KB, created by
Jonathan Druart
on 2025-01-15 11:30:46 UTC
(
hide
)
Description:
Bug 38255: Fix Cash registers
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-01-15 11:30:46 UTC
Size:
2.32 KB
patch
obsolete
>From 8e2b0cdb21e69cdbb68f46b1b846e6469f9cbe98 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 6 Jan 2025 10:14:29 +0100 >Subject: [PATCH] Bug 38255: Fix Cash registers > >This patch fixes the following error: > Uncaught TypeError: table.column is not a function > >We needed to pass table.DataTable() to filterDataTable >I've decided to clean the code as it does not make sense to me: >filterDataTable is called from a single place, and clearFilter is not >needed (we should not interfer with the 'Clear filter' button here) > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../prog/en/modules/admin/cash_registers.tt | 22 +++---------------- > 1 file changed, 3 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt >index 2250ea8f8d6..6b506a6aae0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt >@@ -246,34 +246,18 @@ > [% Asset.js("js/admin-menu.js") | $raw %] > [% INCLUDE 'datatables.inc' %] > <script> >- function filterDataTable( table, column, term ){ >- if( column ){ >- table.column( column ).search( term ).draw(); >- } else { >- table.search( term ).draw(); >- } >- clearFilter( term ); >- } >- >- function clearFilter( term ){ >- if( term == "" ){ >- $(".dt_button_clear_filter").addClass("disabled"); >- } else { >- $(".dt_button_clear_filter").removeClass("disabled"); >- } >- } >- > $(document).ready(function() { > var crtable = $("#table_cash_registers").kohaTable({ > columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }], > order: [[1, "asc"]], > paginationType: "full", > }); >+ var crtable_dt = crtable.DataTable(); > >- $("#branch_filter").on("change", function(){ >+ $("#branch_filter").on("change", function () { > // Table must be filtered by the <option>'s text, not its value > var opt = $(this).find("option:selected").text(); >- filterDataTable( crtable, 2, opt ); >+ crtable_dt.column(2).search(opt).draw(); > }); > > }); >-- >2.34.1
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 38255
:
175181
|
175182
|
175183
|
175184
|
175185
|
175352
|
175598
|
175599
|
175872
|
175873
|
176062
|
176063
|
176064
|
176065
|
176066
|
176067
|
176068
|
176069
|
176070
|
176071
|
176146
|
176348
|
176349
|
176350
|
176351
|
176352
|
176353
|
176354
|
176355
|
176356
|
176357
|
176358
|
176550
|
176551
|
176552
|
176553
|
176554
|
176555
|
176556
|
176557
|
176558
|
176559
|
176560
|
177076
|
177077
|
177078
|
177079
|
177080
|
177081
|
177082
|
177083
|
177084
|
177085
|
177086
|
177214
|
177215
|
177216
|
177217
|
177218
|
177219
|
177220
|
177221
|
177222
|
177223
|
177224
|
177262