rename - refactor

This commit is contained in:
Jan Prochazka 2020-05-10 09:40:15 +02:00
parent 9b39677b93
commit 76ce6acb5e
3 changed files with 5 additions and 5 deletions

View File

@ -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]]);

View File

@ -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}
/> />

View File

@ -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
} }