|
|
|
@ -12,6 +12,7 @@ import {
|
|
|
|
|
OpenNewRecordFormHookInj, |
|
|
|
|
PaginationDataInj, |
|
|
|
|
ReadonlyInj, |
|
|
|
|
ReloadRowDataHookInj, |
|
|
|
|
ReloadViewMetaHookInj, |
|
|
|
|
extractPkFromRow, |
|
|
|
|
inject, |
|
|
|
@ -29,6 +30,7 @@ interface Attachment {
|
|
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
|
const reloadViewMetaHook = inject(ReloadViewMetaHookInj) |
|
|
|
|
const reloadViewDataHook = inject(ReloadViewDataHookInj) |
|
|
|
|
const openNewRecordFormHook = inject(OpenNewRecordFormHookInj, createEventHook()) |
|
|
|
|
|
|
|
|
|
const expandedFormDlg = ref(false) |
|
|
|
@ -85,7 +87,7 @@ const attachments = (record: any): Array<Attachment> => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const expandForm = (row: RowType, _state?: Record<string, any>) => { |
|
|
|
|
const expandForm = (row: RowType, state?: Record<string, any>) => { |
|
|
|
|
if (!isUIAllowed('xcDatatableEditable')) return |
|
|
|
|
|
|
|
|
|
const rowId = extractPkFromRow(row.row, meta.value.columns) |
|
|
|
@ -140,11 +142,17 @@ reloadViewMetaHook?.on(async () => {
|
|
|
|
|
reloadAttachments.value = false |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
reloadViewDataHook?.on(async () => { |
|
|
|
|
await loadData() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
|
await loadData() |
|
|
|
|
await loadGalleryData() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// provide view data reload hook as fallback to row data reload |
|
|
|
|
provide(ReloadRowDataHookInj, reloadViewDataHook) |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|