1
0
Fork 0
mirror of synced 2024-08-19 03:51:29 +12:00

Force a re-initialisation of table data and paging when importing rows to a datasource

This commit is contained in:
Dean 2022-12-05 15:02:39 +00:00
parent 075954b20b
commit 4826f1ef82
3 changed files with 9 additions and 3 deletions

View file

@ -117,6 +117,12 @@
const onUpdateRows = () => {
fetch.refresh()
}
// When importing new rows it is better to reinitialise request/paging data.
// Not doing so causes inconsistency in paging behaviour and content.
const onImportData = () => {
fetch.getInitialData()
}
</script>
<div>
@ -169,7 +175,7 @@
<ImportButton
disabled={$tables.selected?._id === "ta_users"}
tableId={$tables.selected?._id}
on:updaterows={onUpdateRows}
on:importrows={onImportData}
/>
<ExportButton
disabled={!hasRows || !hasCols}

View file

@ -12,5 +12,5 @@
Import
</ActionButton>
<Modal bind:this={modal}>
<ImportModal {tableId} on:updaterows />
<ImportModal {tableId} on:importrows />
</Modal>

View file

@ -29,7 +29,7 @@
}
// Always refresh rows just to be sure
dispatch("updaterows")
dispatch("importrows")
}
</script>