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