From d6eb28e7947f7171c11d4eb0bad84b6f32511984 Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:07:53 -0400 Subject: [PATCH] HPCC-31509 ECL Watch v9 do not show paging counts until known Display ??? rather than 0 rows if the request for items hasn't returned Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- esp/src/src-react/components/controls/Grid.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esp/src/src-react/components/controls/Grid.tsx b/esp/src/src-react/components/controls/Grid.tsx index 28cba6d84fc..e5a4efbb3d5 100644 --- a/esp/src/src-react/components/controls/Grid.tsx +++ b/esp/src/src-react/components/controls/Grid.tsx @@ -165,7 +165,7 @@ export function useFluentStoreState({ page }: FluentStoreStateProps): FluentStor const [selection, setSelection] = React.useState([]); const [pageNum, setPageNum] = React.useState(page); const [pageSize, setPageSize] = React.useState(); - const [total, setTotal] = React.useState(0); + const [total, setTotal] = React.useState(-1); const refreshTable = useRefreshTable(); return { selection, setSelection, pageNum, setPageNum, pageSize, setPageSize, total, setTotal, refreshTable }; @@ -462,7 +462,7 @@ export const FluentPagedFooter: React.FunctionComponent return = 0 ? total : -1} pageCount={Math.ceil(total / pageSize)} format="buttons" onPageChange={index => { setPage(Math.round(index)); updatePage(Math.round(index + 1).toString()); @@ -471,7 +471,7 @@ export const FluentPagedFooter: React.FunctionComponent const start = props.totalItemCount === 0 ? 0 : props.selectedPageIndex === 0 ? 1 : (props.selectedPageIndex * props.itemsPerPage) + 1; const end = (props.itemsPerPage * (props.selectedPageIndex + 1)) > props.totalItemCount ? props.totalItemCount : props.itemsPerPage * (props.selectedPageIndex + 1); return
- {start} {props.strings.divider} {end} {nlsHPCC.Of.toLowerCase()} {props.totalItemCount} {nlsHPCC.Rows} {selectionCount ? `(${selectionCount} ${nlsHPCC.Selected})` : ""} + {start} {props.strings.divider} {end >= 0 ? end : 1} {nlsHPCC.Of.toLowerCase()} {props.totalItemCount >= 0 ? props.totalItemCount : "???"} {nlsHPCC.Rows} {selectionCount ? `(${selectionCount} ${nlsHPCC.Selected})` : ""}
; }} />