update: use callbacks where required.

This commit is contained in:
Darshan
2025-08-27 14:27:19 +05:30
parent e76bdbdaab
commit e3270f65e8
3 changed files with 21 additions and 2 deletions
@@ -16,7 +16,11 @@
<Layout.Stack>
{#each columns as column}
{@const label = column.key}
<ColumnItem {column} bind:formValues {label} />
<ColumnItem
{label}
{column}
{formValues}
onUpdateFormValues={(values) => (formValues = values)} />
{/each}
{#if customId !== undefined}
@@ -119,6 +119,12 @@
createMore = false;
}
});
$effect(() => {
if ($createRow) {
console.log($createRow.row);
}
});
</script>
{#if $createRow}
@@ -118,6 +118,10 @@
firstInput?.focus({ preventScroll: true });
}
function updateRowData(values: object) {
work.set(values as Models.Row);
}
</script>
{#if $table.columns?.length && work}
@@ -125,7 +129,12 @@
<Layout.Stack direction="column" gap="l">
{#each $table.columns as column}
{@const label = column.key}
<ColumnItem {column} bind:formValues={$work} {label} editing />
<ColumnItem
{column}
{label}
editing
formValues={$work}
onUpdateFormValues={updateRowData} />
{/each}
</Layout.Stack>
</div>