You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we have the lookupField and lookupValue to dynamically insert values in the settings.url for both forms or tables. But this is very limited when we need to add more than one dynamic value in the URL.
Propose
Allow dynamic URL route matching with parameters. This idea is absolutely inspired by vue-router.
To achieve this behavior, we can use the dynamic placeholders that we're currently using on the button's labels
<script lang="ts" setup>
const form =useForm({// Other properties... settings: { url: '{{ albums/:album_id/tracks | albums/:album_id/tracks/:id }}', },})
</script>
Another way to achieve this behavior is accepting a function on the URL. The function should receive the formMode and the record object, then should return the URL string.
<script lang="ts" setup>
const form =useForm({// Other properties... settings: {url: (context: { mode:FormMode; record:any }):string=> {const { mode, record } =contextconst CREATE_URL =`albums/${record.albumId}/tracks`const UPDATE_URL =`albums/${record.albumId}/tracks/${record.id}`returnmode===FORM_MODE.create?CREATE_URL:UPDATE_URL }, },})
</script>
The text was updated successfully, but these errors were encountered:
Describe
Currently, we have the
lookupField
andlookupValue
to dynamically insert values in thesettings.url
for bothforms
ortables
. But this is very limited when we need to add more than one dynamic value in the URL.Propose
Allow dynamic URL route matching with parameters. This idea is absolutely inspired by vue-router.
To achieve this behavior, we can use the dynamic placeholders that we're currently using on the button's labels
Another way to achieve this behavior is accepting a function on the URL. The function should receive the
formMode
and the record object, then should return the URL string.The text was updated successfully, but these errors were encountered: