From 63642fac37048daab370e8f9e958121e724609a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Tue, 14 Jan 2025 12:13:12 +0700 Subject: [PATCH] Fix entries now showing when updating empty data table --- assets/packs/data_table/App.js | 2 +- assets/packs/data_table/LimitSelect.js | 2 +- lib/assets/data_table/build/main.js | 52 +++++++++++++------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/assets/packs/data_table/App.js b/assets/packs/data_table/App.js index d8aafec3..58624206 100644 --- a/assets/packs/data_table/App.js +++ b/assets/packs/data_table/App.js @@ -103,7 +103,6 @@ export function App({ ctx, data }) { const columnsInitData = getColumnsData(data.content.columns); const hasRefetch = data.features.includes("refetch"); const hasExport = data.features.includes("export"); - const hasData = data.content.columns.length !== 0; const hasSummaries = summariesItems.length > 0; const hasSorting = data.features.includes("sorting"); const hasRelocate = data.features.includes("relocate"); @@ -124,6 +123,7 @@ export function App({ ctx, data }) { const [rowMarkerOffset, setRowMarkerOffset] = useState(0); const [hoverRows, setHoverRows] = useState(null); + const hasData = content.columns.length !== 0; const totalRows = content.total_rows; const hasEntries = hasData && totalRows > 0; diff --git a/assets/packs/data_table/LimitSelect.js b/assets/packs/data_table/LimitSelect.js index 66358ee9..85d2c689 100644 --- a/assets/packs/data_table/LimitSelect.js +++ b/assets/packs/data_table/LimitSelect.js @@ -8,7 +8,7 @@ export default function LimitSelect({ limit, totalRows, onChange }) {
-
+