mirror of
https://github.com/dbgate/dbgate
synced 2024-11-08 04:35:58 +00:00
rename - refactor
This commit is contained in:
parent
9b39677b93
commit
76ce6acb5e
@ -429,8 +429,8 @@ export default function DataGridCore(props) {
|
|||||||
}, [jslid]);
|
}, [jslid]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (props.onRefSourceRowsChanged && ((loadedRows && loadedRows.length > 0) || isLoadedAll)) {
|
if (props.onReferenceSourceChanged && ((loadedRows && loadedRows.length > 0) || isLoadedAll)) {
|
||||||
props.onRefSourceRowsChanged(getSelectedRowData(), loadedTime);
|
props.onReferenceSourceChanged(getSelectedRowData(), loadedTime);
|
||||||
}
|
}
|
||||||
}, [selectedCells, props.refReloadToken, loadedRows && loadedRows[0]]);
|
}, [selectedCells, props.refReloadToken, loadedRows && loadedRows[0]]);
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ export default function TableDataGrid({
|
|||||||
}
|
}
|
||||||
}, [conid, database, display]);
|
}, [conid, database, display]);
|
||||||
|
|
||||||
const handleRefSourcedRowsChanged = React.useCallback(
|
const handleReferenceSourceChanged = React.useCallback(
|
||||||
(selectedRows, loadedTime) => {
|
(selectedRows, loadedTime) => {
|
||||||
setMyLoadedTime(loadedTime);
|
setMyLoadedTime(loadedTime);
|
||||||
if (!reference) return;
|
if (!reference) return;
|
||||||
@ -113,7 +113,7 @@ export default function TableDataGrid({
|
|||||||
toolbarPortalRef={toolbarPortalRef}
|
toolbarPortalRef={toolbarPortalRef}
|
||||||
showReferences
|
showReferences
|
||||||
onReferenceClick={setReference}
|
onReferenceClick={setReference}
|
||||||
onRefSourceRowsChanged={reference ? handleRefSourcedRowsChanged : null}
|
onReferenceSourceChanged={reference ? handleReferenceSourceChanged : null}
|
||||||
refReloadToken={refReloadToken.toString()}
|
refReloadToken={refReloadToken.toString()}
|
||||||
masterLoadedTime={masterLoadedTime}
|
masterLoadedTime={masterLoadedTime}
|
||||||
/>
|
/>
|
||||||
|
@ -11,7 +11,7 @@ export interface DataGridProps {
|
|||||||
jslid?: string;
|
jslid?: string;
|
||||||
showReferences?: boolean;
|
showReferences?: boolean;
|
||||||
onReferenceClick?: (def: GridReferenceDefinition) => void;
|
onReferenceClick?: (def: GridReferenceDefinition) => void;
|
||||||
onRefSourceRowsChanged?: Function;
|
onReferenceSourceChanged?: Function;
|
||||||
refReloadToken?: string;
|
refReloadToken?: string;
|
||||||
masterLoadedTime?: number
|
masterLoadedTime?: number
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user