From e655df511ddee6fa8bccc3039982a31ee2f3b4ed Mon Sep 17 00:00:00 2001 From: Cristine Guadelupe Date: Fri, 5 May 2023 20:55:44 +0300 Subject: [PATCH] Support for lazy data frames --- assets/data_table/main.js | 9 +++++---- lib/assets/data_table/build/main.js | 2 +- lib/kino/table.ex | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/data_table/main.js b/assets/data_table/main.js index df67450e..850b9d07 100644 --- a/assets/data_table/main.js +++ b/assets/data_table/main.js @@ -136,7 +136,7 @@ function App({ ctx, data }) { const fixedHeight = 440 + headerHeight; const minRowsToFitMenu = hasSorting ? 3 : 2; const autoHeight = - totalRows < minRowsToFitMenu && menu ? menuHeight + headerHeight : null; + totalRows && totalRows < minRowsToFitMenu && menu ? menuHeight + headerHeight : null; const height = totalRows >= 10 && infiniteScroll ? fixedHeight : autoHeight; const rowMarkerStartIndex = (content.page - 1) * content.limit + 1; const minColumnWidth = hasSummaries ? 150 : 50; @@ -474,6 +474,7 @@ function App({ ctx, data }) { maxPage={content.max_page} onPrev={onPrev} onNext={onNext} + rows={rows} /> )} @@ -566,14 +567,14 @@ function LimitSelect({ limit, totalRows, onChange }) { - + {totalRows ? : null} ); } -function Pagination({ page, maxPage, onPrev, onNext }) { +function Pagination({ page, maxPage, onPrev, onNext, rows }) { return (