From 2b8f627fbebcaa2e30e561b25dbfe65877398cf0 Mon Sep 17 00:00:00 2001 From: Becky Smith Date: Wed, 17 Jul 2024 16:19:07 +0100 Subject: [PATCH] Allow custom pagination perpage for datatables --- assets/src/scripts/_datatable.js | 2 +- templates/_components/index.html | 3 ++- templates/_components/table/table.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/src/scripts/_datatable.js b/assets/src/scripts/_datatable.js index 481169d83..2b474ab50 100644 --- a/assets/src/scripts/_datatable.js +++ b/assets/src/scripts/_datatable.js @@ -75,7 +75,7 @@ const initCustomTable = async () => { const dataTable = new DataTable(tableEl, { paging: true, - perPage: 25, + perPage: tableEl.dataset.perpage ? tableEl.dataset.perpage : 25, searchable: true, sortable: true, tableRender: (_data, table) => { diff --git a/templates/_components/index.html b/templates/_components/index.html index 50c96c2fa..d03e6b859 100644 --- a/templates/_components/index.html +++ b/templates/_components/index.html @@ -691,7 +691,7 @@

List group rich item

Modal