Prevent row bulk deletion when delete rows flag is set to false
This commit is contained in:
parent
023cb2b83b
commit
80da2fb93a
2 changed files with 6 additions and 3 deletions
|
@ -145,7 +145,9 @@
|
||||||
<ProgressCircle />
|
<ProgressCircle />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if allowDeleteRows}
|
||||||
<BulkDeleteHandler />
|
<BulkDeleteHandler />
|
||||||
|
{/if}
|
||||||
<KeyboardManager />
|
<KeyboardManager />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
clipboard,
|
clipboard,
|
||||||
dispatch,
|
dispatch,
|
||||||
selectedRows,
|
selectedRows,
|
||||||
|
config,
|
||||||
} = getContext("grid")
|
} = getContext("grid")
|
||||||
|
|
||||||
const ignoredOriginSelectors = [
|
const ignoredOriginSelectors = [
|
||||||
|
@ -40,7 +41,7 @@
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
dispatch("add-row-inline")
|
dispatch("add-row-inline")
|
||||||
} else if (e.key === "Delete" || e.key === "Backspace") {
|
} else if (e.key === "Delete" || e.key === "Backspace") {
|
||||||
if (Object.keys($selectedRows).length) {
|
if (Object.keys($selectedRows).length && $config.allowDeleteRows) {
|
||||||
dispatch("request-bulk-delete")
|
dispatch("request-bulk-delete")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +107,7 @@
|
||||||
break
|
break
|
||||||
case "Delete":
|
case "Delete":
|
||||||
case "Backspace":
|
case "Backspace":
|
||||||
if (Object.keys($selectedRows).length) {
|
if (Object.keys($selectedRows).length && $config.allowDeleteRows) {
|
||||||
dispatch("request-bulk-delete")
|
dispatch("request-bulk-delete")
|
||||||
} else {
|
} else {
|
||||||
deleteSelectedCell()
|
deleteSelectedCell()
|
||||||
|
|
Loading…
Reference in a new issue