mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fixed performance bug in grid
This commit is contained in:
parent
9fe0c2ac86
commit
2cd2546f3f
@ -300,6 +300,16 @@ export default function DataGridCore(props) {
|
||||
return `Rows: ${allRowCount.toLocaleString()}`;
|
||||
}, [selectedCells, allRowCount, grider, visibleRealColumns]);
|
||||
|
||||
const handleSetFormView = React.useMemo(
|
||||
() =>
|
||||
formViewAvailable && display.baseTable && display.baseTable.primaryKey
|
||||
? (rowData) => {
|
||||
display.switchToFormView(rowData);
|
||||
}
|
||||
: null,
|
||||
[formViewAvailable, display]
|
||||
);
|
||||
|
||||
if (!columns || columns.length == 0) return <LoadingInfo wrapper message="Waiting for structure" />;
|
||||
|
||||
if (errorMessage) {
|
||||
@ -949,13 +959,6 @@ export default function DataGridCore(props) {
|
||||
display.clearFilters();
|
||||
};
|
||||
|
||||
const handleSetFormView =
|
||||
formViewAvailable && display.baseTable && display.baseTable.primaryKey
|
||||
? (rowData) => {
|
||||
display.switchToFormView(rowData);
|
||||
}
|
||||
: null;
|
||||
|
||||
const handleSwitchToFormView =
|
||||
formViewAvailable && display.baseTable && display.baseTable.primaryKey
|
||||
? () => {
|
||||
|
Loading…
Reference in New Issue
Block a user