WIP - related lists and look up field
This commit is contained in:
@@ -81,6 +81,20 @@ const handleDelete = async (rows: any[]) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle navigation to related records
|
||||
const handleNavigate = (objectApiName: string, recordId: string) => {
|
||||
router.push(`/central/${objectApiName}/${recordId}/detail`)
|
||||
}
|
||||
|
||||
// Handle creating related records
|
||||
const handleCreateRelated = (objectApiName: string, parentId: string) => {
|
||||
// Navigate to create page with parent context
|
||||
router.push({
|
||||
path: `/central/${objectApiName}/new`,
|
||||
query: { tenantId: parentId }
|
||||
})
|
||||
}
|
||||
|
||||
const handleSaveRecord = async (data: any) => {
|
||||
try {
|
||||
const savedRecord = await handleSave(data)
|
||||
@@ -137,6 +151,8 @@ onMounted(async () => {
|
||||
@edit="handleEdit"
|
||||
@delete="() => handleDelete([currentRecord])"
|
||||
@back="handleBack"
|
||||
@navigate="handleNavigate"
|
||||
@create-related="handleCreateRelated"
|
||||
/>
|
||||
|
||||
<!-- Edit View -->
|
||||
|
||||
Reference in New Issue
Block a user