diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte
index 0c0365b9b8..02922c5c71 100644
--- a/packages/builder/src/components/backend/DataTable/Table.svelte
+++ b/packages/builder/src/components/backend/DataTable/Table.svelte
@@ -22,9 +22,6 @@
import { getRenderer, editRowRenderer } from "./cells/cellRenderers";
import TableHeader from "./TableHeader"
- // const ITEMS_PER_PAGE = 10
-
-
export let schema = []
export let data = []
export let title
@@ -43,21 +40,16 @@
filter: true,
},
rowSelection: "multiple",
+ rowMultiSelectWithClick: true,
suppressRowClickSelection: false,
paginationAutoPageSize: true,
+ pagination: true,
+ enableRangeSelection: true,
+ popupParent: document.body,
}
- // let currentPage = 0
- // $: columns = schema ? Object.keys(schema) : []
- // $: sort = $backendUiStore.sort
- // $: sorted = sort ? fsort(data)[sort.direction](sort.column) : data
- // $: paginatedData =
- // sorted && sorted.length
- // ? sorted.slice(
- // currentPage * ITEMS_PER_PAGE,
- // currentPage * ITEMS_PER_PAGE + ITEMS_PER_PAGE
- // )
- // : []
+ $: console.log(options)
+
// TODO: refactor
$: {
let result = []
@@ -67,6 +59,8 @@
sortable: false,
resizable: false,
suppressMovable: true,
+ suppressMenu: true,
+ minWidth: 0,
width: 10,
cellRenderer: editRowRenderer
})
@@ -91,29 +85,29 @@
}
$: tableId = data?.length ? data[0].tableId : null
- function selectRelationship(row, fieldName) {
- if (!row?.[fieldName]?.length) {
- return
- }
- $goto(
- `/${$params.application}/data/table/${tableId}/relationship/${row._id}/${fieldName}`
- )
- }
+ // function selectRelationship(row, fieldName) {
+ // if (!row?.[fieldName]?.length) {
+ // return
+ // }
+ // $goto(
+ // `/${$params.application}/data/table/${tableId}/relationship/${row._id}/${fieldName}`
+ // )
+ // }
// New stuff
- const deleteRows = async () => {
- const response = await api.post(`/api/${tableId}/rows`, {
- rows: selectedRows,
- type: "delete",
- })
- data = data.filter(row => !selectedRows.includes(row))
- selectedRows = []
- }
+ // const deleteRows = async () => {
+ // const response = await api.post(`/api/${tableId}/rows`, {
+ // rows: selectedRows,
+ // type: "delete",
+ // })
+ // data = data.filter(row => !selectedRows.includes(row))
+ // selectedRows = []
+ // }
- const handleUpdate = ({ detail }) => {
- data[detail.row] = detail.data
- updateRow(detail.data)
- }
+ // const handleUpdate = ({ detail }) => {
+ // data[detail.row] = detail.data
+ // updateRow(detail.data)
+ // }
@@ -135,68 +129,7 @@
{options}
{data}
{columnDefs}
- on:update={handleUpdate}
- on:select={({ detail }) => (console.log(detail))} />
-
-
+ />
diff --git a/packages/builder/src/components/backend/DataTable/TableHeader/index.js b/packages/builder/src/components/backend/DataTable/TableHeader/index.js
index 5507961657..26231035d6 100644
--- a/packages/builder/src/components/backend/DataTable/TableHeader/index.js
+++ b/packages/builder/src/components/backend/DataTable/TableHeader/index.js
@@ -42,12 +42,15 @@ export default class TableHeaderWrapper {
init(params) {
console.log("init", params)
this.agParams = params
- const container = document.createElement("div")
- new TableHeader({
- target: container,
+ this.container = document.createElement("div")
+ this.container.style.height = "100%"
+ this.container.style.width = "100%"
+
+ this.headerComponent = new TableHeader({
+ target: this.container,
props: params,
})
- this.eGui = container
+ this.eGui = this.container
}
// can get called more than once, you should return the HTML element
@@ -57,6 +60,11 @@ export default class TableHeaderWrapper {
// gets called when a new Column Definition has been set for this header
refresh(params) {
+ this.agParams = params
+ this.headerComponent = new TableHeader({
+ target: this.container,
+ props: params,
+ })
console.log("Refreshing", params)
}
diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte
index 7ddced256e..1f315ebe71 100644
--- a/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte
+++ b/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte
@@ -1,27 +1,28 @@
-
-