From 6fde4a5ce7bfd0ff68649a5eac8aa1be09c1718e Mon Sep 17 00:00:00 2001 From: Petr Kachanovsky Date: Wed, 5 Feb 2025 09:15:14 +0200 Subject: [PATCH] docs: add unset label section to foreign resources documentation --- .../13-standardPagesTuning.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md b/adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md index 325b7a323..c2554e5a5 100644 --- a/adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md +++ b/adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md @@ -493,6 +493,29 @@ export default { This way, when creating or editing a record you will be able to choose value for this field from a dropdown selector and on list and show pages this field will be displayed as a link to a foreign resource. +### Unset label + +When foreign resource column is not required, selector will have an 'Unset' option that will set field to `null`. You can change label for this option using `unsetLabel`, like so: + +```typescript title="./resources/adminuser.ts" +export default { + name: 'adminuser', + columns: [ + ... + { + name: "realtor_id", + foreignResource: { + resourceId: 'adminuser', +//diff-add + unsetLabel: 'No realtor', + }, + }, + ], + }, + ... + ], +``` + ## Filtering ### Filter Options