Fix importing and exporting with sheets

This commit is contained in:
Andrew Kingston 2023-04-12 10:03:58 +01:00
parent 7fa976ba5e
commit 7bbb8e5648
2 changed files with 4 additions and 8 deletions

View File

@ -2,7 +2,7 @@
import ExportButton from "../ExportButton.svelte"
import { getContext } from "svelte"
const { rows, columns, config, sort, selectedRows, filter } =
const { rows, columns, tableId, sort, selectedRows, filter } =
getContext("sheet")
$: disabled = !$rows.length || !$columns.length
@ -11,7 +11,7 @@
<ExportButton
{disabled}
view={$config.tableId}
view={$tableId}
filters={$filter}
sorting={{
sortColumn: $sort.column,

View File

@ -2,11 +2,7 @@
import ImportButton from "../ImportButton.svelte"
import { getContext } from "svelte"
const { rows, config } = getContext("sheet")
const refresh = () => {
rows.actions.refreshData()
}
const { rows, tableId } = getContext("sheet")
</script>
<ImportButton tableId={$config.tableId} on:importrows={refresh} />
<ImportButton tableId={$tableId} on:importrows={rows.actions.refreshData} />