Fix legacy delete button in edit row modal not doing anything
This commit is contained in:
parent
c08db11859
commit
128411a61b
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import CreateEditRow from "../../modals/CreateEditRow.svelte"
|
import CreateEditRow from "../../modals/CreateEditRow.svelte"
|
||||||
import { getContext, onMount } from "svelte"
|
import { getContext, onMount } from "svelte"
|
||||||
import { Modal } from "@budibase/bbui"
|
import { Modal, notifications } from "@budibase/bbui"
|
||||||
import { cloneDeep } from "lodash/fp"
|
import { cloneDeep } from "lodash/fp"
|
||||||
|
|
||||||
const { subscribe, rows } = getContext("grid")
|
const { subscribe, rows } = getContext("grid")
|
||||||
|
@ -9,6 +9,11 @@
|
||||||
let modal
|
let modal
|
||||||
let row
|
let row
|
||||||
|
|
||||||
|
const deleteRow = e => {
|
||||||
|
rows.actions.deleteRows([e.detail])
|
||||||
|
notifications.success("Deleted 1 row")
|
||||||
|
}
|
||||||
|
|
||||||
onMount(() =>
|
onMount(() =>
|
||||||
subscribe("add-row", () => {
|
subscribe("add-row", () => {
|
||||||
row = {}
|
row = {}
|
||||||
|
@ -24,5 +29,9 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal bind:this={modal}>
|
<Modal bind:this={modal}>
|
||||||
<CreateEditRow {row} on:updaterows={e => rows.actions.refreshRow(e.detail)} />
|
<CreateEditRow
|
||||||
|
{row}
|
||||||
|
on:updaterows={e => rows.actions.refreshRow(e.detail)}
|
||||||
|
on:deleteRows={deleteRow}
|
||||||
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
Loading…
Reference in New Issue