From c4a886f77004c9c9e9e53194c8e5656ea08712e9 Mon Sep 17 00:00:00 2001 From: wbchen Date: Wed, 17 Jul 2024 10:31:41 +0800 Subject: [PATCH] Add jump to the specified page --- src/itables/html/datatables_template.html | 54 ++++++++++++++++++++++- src/itables/javascript.py | 8 ++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/src/itables/html/datatables_template.html b/src/itables/html/datatables_template.html index da686119..0a741476 100644 --- a/src/itables/html/datatables_template.html +++ b/src/itables/html/datatables_template.html @@ -1,4 +1,29 @@
A
+ +
+
+ 跳转到第 页 + +
+
+ diff --git a/src/itables/javascript.py b/src/itables/javascript.py index e61b8598..fa065ebc 100644 --- a/src/itables/javascript.py +++ b/src/itables/javascript.py @@ -810,6 +810,14 @@ def html_table_from_template( output = replace_value(output, 'dt_args["data"] = data;', "") output = replace_value(output, "const data = [];", "") + # ---------------------------hack for pagination jump start--------------------------------- + + output = output.replace("jumpPageBtntable_id", "jumpPageBtn"+table_id) + output = output.replace("jumpPageInputtable_id", "jumpPageInput"+table_id) + output = output.replace("itable_id", table_id) + + # ---------------------------hack for pagination jump end--------------------------------- + return output