Skip to content

Commit dcfd025

Browse files
authored
Merge pull request #112 from devforth/foreign-resource-unset-label
docs: add unset label section to foreign resources documentation
2 parents baf835b + 6fde4a5 commit dcfd025

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,29 @@ export default {
493493

494494
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.
495495

496+
### Unset label
497+
498+
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:
499+
500+
```typescript title="./resources/adminuser.ts"
501+
export default {
502+
name: 'adminuser',
503+
columns: [
504+
...
505+
{
506+
name: "realtor_id",
507+
foreignResource: {
508+
resourceId: 'adminuser',
509+
//diff-add
510+
unsetLabel: 'No realtor',
511+
},
512+
},
513+
],
514+
},
515+
...
516+
],
517+
```
518+
496519
## Filtering
497520

498521
### Filter Options

0 commit comments

Comments
 (0)