Force a re-initialisation of table data and paging when importing rows to a datasource
This commit is contained in:
parent
e595b34e48
commit
2eac4afbc9
|
@ -117,6 +117,12 @@
|
||||||
const onUpdateRows = () => {
|
const onUpdateRows = () => {
|
||||||
fetch.refresh()
|
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>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
@ -169,7 +175,7 @@
|
||||||
<ImportButton
|
<ImportButton
|
||||||
disabled={$tables.selected?._id === "ta_users"}
|
disabled={$tables.selected?._id === "ta_users"}
|
||||||
tableId={$tables.selected?._id}
|
tableId={$tables.selected?._id}
|
||||||
on:updaterows={onUpdateRows}
|
on:importrows={onImportData}
|
||||||
/>
|
/>
|
||||||
<ExportButton
|
<ExportButton
|
||||||
disabled={!hasRows || !hasCols}
|
disabled={!hasRows || !hasCols}
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
Import
|
Import
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<Modal bind:this={modal}>
|
<Modal bind:this={modal}>
|
||||||
<ImportModal {tableId} on:updaterows />
|
<ImportModal {tableId} on:importrows />
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always refresh rows just to be sure
|
// Always refresh rows just to be sure
|
||||||
dispatch("updaterows")
|
dispatch("importrows")
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue