mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 15:56:00 +00:00
data grid optimalization
This commit is contained in:
@@ -121,14 +121,15 @@
|
||||
</script>
|
||||
|
||||
<DataGridCore
|
||||
bind:this={domGrid}
|
||||
{...$$props}
|
||||
bind:this={domGrid}
|
||||
bind:selectedCellsPublished
|
||||
onLoadNextData={handleLoadNextData}
|
||||
{errorMessage}
|
||||
{grider}
|
||||
{isLoading}
|
||||
allRowCount={rowCountLoaded || allRowCount}
|
||||
{isLoadedAll}
|
||||
{loadedTime}
|
||||
bind:selectedCellsPublished
|
||||
{grider}
|
||||
{display}
|
||||
/>
|
||||
|
||||
@@ -100,16 +100,29 @@
|
||||
|
||||
let loadedRows = [];
|
||||
|
||||
let grider;
|
||||
|
||||
// $: console.log('loadedRows BIND', loadedRows);
|
||||
$: grider = new ChangeSetGrider(
|
||||
loadedRows,
|
||||
changeSetState,
|
||||
dispatchChangeSet,
|
||||
display,
|
||||
macroPreview,
|
||||
macroValues,
|
||||
selectedCellsPublished()
|
||||
);
|
||||
|
||||
$: {
|
||||
if (macroPreview) {
|
||||
grider = new ChangeSetGrider(
|
||||
loadedRows,
|
||||
changeSetState,
|
||||
dispatchChangeSet,
|
||||
display,
|
||||
macroPreview,
|
||||
macroValues,
|
||||
selectedCellsPublished()
|
||||
);
|
||||
}
|
||||
}
|
||||
// prevent recreate grider, if no macro is selected, so there is no need to selectedcells in macro
|
||||
$: {
|
||||
if (!macroPreview) {
|
||||
grider = new ChangeSetGrider(loadedRows, changeSetState, dispatchChangeSet, display);
|
||||
}
|
||||
}
|
||||
// $: console.log('GRIDER', grider);
|
||||
// $: if (onChangeGrider) onChangeGrider(grider);
|
||||
|
||||
@@ -200,4 +213,5 @@
|
||||
bind:selectedCellsPublished
|
||||
frameSelection={!!macroPreview}
|
||||
{grider}
|
||||
{display}
|
||||
/>
|
||||
|
||||
@@ -58,8 +58,6 @@
|
||||
|
||||
const childCache = writable(createGridCache());
|
||||
|
||||
// $: console.log('display', display);
|
||||
|
||||
$: display =
|
||||
connection && $serverVersion
|
||||
? new TableGridDisplay(
|
||||
|
||||
@@ -6,6 +6,8 @@ import Grider from './Grider';
|
||||
import { isJsonLikeLongString, safeJsonParse } from 'dbgate-tools';
|
||||
|
||||
export function countColumnSizes(grider: Grider, columns, containerWidth, display: GridDisplay) {
|
||||
// console.log('COUNT SIZES');
|
||||
|
||||
const columnSizes = new SeriesSizes();
|
||||
if (!grider || !columns || !display) return columnSizes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user