Improve grid relationship handling of null or empty values
This commit is contained in:
parent
2c611574e3
commit
81ca0fdd1c
|
@ -6,6 +6,10 @@
|
||||||
export let columnName
|
export let columnName
|
||||||
export let row
|
export let row
|
||||||
|
|
||||||
|
$: count =
|
||||||
|
row && columnName && Array.isArray(row[columnName])
|
||||||
|
? row[columnName].length
|
||||||
|
: 0
|
||||||
let linkedRows = []
|
let linkedRows = []
|
||||||
let displayColumn
|
let displayColumn
|
||||||
|
|
||||||
|
@ -33,9 +37,11 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{#if linkedRows && linkedRows.length && displayColumn}
|
{#if linkedRows && linkedRows.length && displayColumn}
|
||||||
{#each linkedRows as linkedRow}
|
{#each linkedRows as linkedRow}
|
||||||
|
{#if linkedRow[displayColumn] != null && linkedRow[displayColumn] !== ''}
|
||||||
<div class="linked-row">{linkedRow[displayColumn]}</div>
|
<div class="linked-row">{linkedRow[displayColumn]}</div>
|
||||||
{/each}
|
|
||||||
{/if}
|
{/if}
|
||||||
|
{/each}
|
||||||
|
{:else}{count} related row(s){/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in New Issue