- {#if linkedRows && linkedRows.length && displayColumn}
- {#each linkedRows as linkedRow}
- {#if linkedRow[displayColumn] != null && linkedRow[displayColumn] !== ''}
-
{linkedRow[displayColumn]}
- {/if}
- {/each}
- {:else}{count} related row(s){/if}
+
selectRelationship(row, columnName)}>
+ {count}
+ related row(s)
diff --git a/packages/builder/src/components/backend/DataTable/cells/cellRenderers.js b/packages/builder/src/components/backend/DataTable/cells/cellRenderers.js
index 2c1463b6d1..463123d577 100644
--- a/packages/builder/src/components/backend/DataTable/cells/cellRenderers.js
+++ b/packages/builder/src/components/backend/DataTable/cells/cellRenderers.js
@@ -6,7 +6,6 @@ import RelationshipDisplay from "./RelationshipCell.svelte"
const renderers = {
attachment: attachmentRenderer,
link: linkedRowRenderer,
- boolean: booleanRenderer,
}
export function getRenderer(schema, editable) {
@@ -30,33 +29,6 @@ export function editRowRenderer(params) {
return container
}
-/* eslint-disable no-unused-vars */
-function booleanRenderer(options, constraints) {
- return params => {
- let container = document.createElement("input")
-
- // TODO: implement
-
- return container
-
- // const toggle = e => {
- // params.value = !params.value
- // params.setValue(e.currentTarget.checked)
- // }
- // let input = document.createElement("input")
- // input.style.display = "grid"
- // input.style.placeItems = "center"
- // input.style.height = "100%"
- // input.type = "checkbox"
- // input.checked = params.value
- // if (editable) {
- // input.addEventListener("click", toggle)
- // } else {
- // input.disabled = true
- // }
- // return input
- }
-}
/* eslint-disable no-unused-vars */
function attachmentRenderer(options, constraints, editable) {
@@ -82,11 +54,10 @@ function attachmentRenderer(options, constraints, editable) {
}
/* eslint-disable no-unused-vars */
-function linkedRowRenderer(options, constraints, editable) {
+function linkedRowRenderer() {
return params => {
let container = document.createElement("div")
container.style.display = "grid"
- container.style.placeItems = "center"
container.style.height = "100%"
new RelationshipDisplay({
@@ -94,6 +65,7 @@ function linkedRowRenderer(options, constraints, editable) {
props: {
row: params.data,
columnName: params.column.colId,
+ selectRelationship: params.selectRelationship
},
})