Fix grid import and export for tables
This commit is contained in:
parent
c7c9bd6563
commit
1aea6fce09
|
@ -2,7 +2,7 @@
|
||||||
import ExportButton from "../ExportButton.svelte"
|
import ExportButton from "../ExportButton.svelte"
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
|
|
||||||
const { rows, columns, tableId, sort, selectedRows, filter } =
|
const { rows, columns, datasource, sort, selectedRows, filter } =
|
||||||
getContext("grid")
|
getContext("grid")
|
||||||
|
|
||||||
$: disabled = !$rows.length || !$columns.length
|
$: disabled = !$rows.length || !$columns.length
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<span data-ignore-click-outside="true">
|
<span data-ignore-click-outside="true">
|
||||||
<ExportButton
|
<ExportButton
|
||||||
{disabled}
|
{disabled}
|
||||||
view={$tableId}
|
view={$datasource.tableId}
|
||||||
filters={$filter}
|
filters={$filter}
|
||||||
sorting={{
|
sorting={{
|
||||||
sortColumn: $sort.column,
|
sortColumn: $sort.column,
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
|
|
||||||
const { rows, tableId, table } = getContext("grid")
|
const { rows, datasource, table } = getContext("grid")
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ImportButton
|
<ImportButton
|
||||||
{disabled}
|
{disabled}
|
||||||
tableId={$tableId}
|
tableId={$datasource.tableId}
|
||||||
tableType={$table?.type}
|
tableType={$table?.type}
|
||||||
on:importrows={rows.actions.refreshData}
|
on:importrows={rows.actions.refreshData}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue