mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fix #56
This commit is contained in:
parent
99746f48df
commit
35398dd401
@ -40,6 +40,7 @@ async function loadRowCount(props) {
|
||||
export default function JslDataGridCore(props) {
|
||||
const { jslid } = props;
|
||||
const [changeIndex, setChangeIndex] = React.useState(0);
|
||||
const [rowCountLoaded, setRowCountLoaded]= React.useState(null);
|
||||
|
||||
const showModal = useShowModal();
|
||||
|
||||
@ -65,6 +66,7 @@ export default function JslDataGridCore(props) {
|
||||
(stats) => {
|
||||
if (stats.changeIndex < changeIndex) return;
|
||||
setChangeIndex(stats.changeIndex);
|
||||
setRowCountLoaded(stats.rowCount);
|
||||
},
|
||||
[changeIndex]
|
||||
);
|
||||
@ -85,6 +87,7 @@ export default function JslDataGridCore(props) {
|
||||
loadDataPage={loadDataPage}
|
||||
dataPageAvailable={dataPageAvailable}
|
||||
loadRowCount={loadRowCount}
|
||||
rowCountLoaded={rowCountLoaded}
|
||||
loadNextDataToken={changeIndex}
|
||||
onReload={() => setChangeIndex(0)}
|
||||
griderFactory={RowsArrayGrider.factory}
|
||||
|
@ -14,6 +14,7 @@ export default function LoadingDataGridCore(props) {
|
||||
griderFactory,
|
||||
griderFactoryDeps,
|
||||
onChangeGrider,
|
||||
rowCountLoaded,
|
||||
} = props;
|
||||
|
||||
const [loadProps, setLoadProps] = React.useState({
|
||||
@ -131,7 +132,7 @@ export default function LoadingDataGridCore(props) {
|
||||
isLoadedAll={isLoadedAll}
|
||||
loadedTime={loadedTime}
|
||||
exportGrid={exportGrid}
|
||||
allRowCount={allRowCount}
|
||||
allRowCount={rowCountLoaded || allRowCount}
|
||||
openQuery={openQuery}
|
||||
isLoading={isLoading}
|
||||
grider={grider}
|
||||
|
Loading…
Reference in New Issue
Block a user