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