removes add row button on grid component
This commit is contained in:
parent
3174441e4c
commit
1bffa76194
|
@ -11,7 +11,6 @@
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
|
|
||||||
import AgGrid from "@budibase/svelte-ag-grid"
|
import AgGrid from "@budibase/svelte-ag-grid"
|
||||||
import CreateRowButton from "./CreateRow/Button.svelte"
|
|
||||||
import { TextButton as DeleteButton, Icon, Modal, ModalContent } from "@budibase/bbui"
|
import { TextButton as DeleteButton, Icon, Modal, ModalContent } from "@budibase/bbui"
|
||||||
|
|
||||||
export let _bb
|
export let _bb
|
||||||
|
@ -79,13 +78,6 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const isEditable = type =>
|
|
||||||
type !== "boolean" &&
|
|
||||||
type !== "options" &&
|
|
||||||
// type !== "datetime" &&
|
|
||||||
type !== "link" &&
|
|
||||||
type !== "attachment"
|
|
||||||
|
|
||||||
const shouldHideField = name => {
|
const shouldHideField = name => {
|
||||||
if (name.startsWith("_")) return true
|
if (name.startsWith("_")) return true
|
||||||
// always 'row'
|
// always 'row'
|
||||||
|
@ -96,10 +88,6 @@
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleNewRow = async () => {
|
|
||||||
data = await fetchData(datasource)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleUpdate = ({ detail }) => {
|
const handleUpdate = ({ detail }) => {
|
||||||
data[detail.row] = detail.data
|
data[detail.row] = detail.data
|
||||||
updateRow(detail.data)
|
updateRow(detail.data)
|
||||||
|
@ -133,7 +121,6 @@
|
||||||
{#if dataLoaded}
|
{#if dataLoaded}
|
||||||
{#if canAddDelete}
|
{#if canAddDelete}
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<CreateRowButton {_bb} {table} on:newRow={handleNewRow} />
|
|
||||||
{#if selectedRows.length > 0}
|
{#if selectedRows.length > 0}
|
||||||
<DeleteButton text small on:click={modal.show()}>
|
<DeleteButton text small on:click={modal.show()}>
|
||||||
<Icon name="addrow" />
|
<Icon name="addrow" />
|
||||||
|
|
Loading…
Reference in New Issue