ng-admin icon indicating copy to clipboard operation
ng-admin copied to clipboard

How to render a 'reference_many' field just like a 'referenced_list' field

Open garethsb-ghost opened this issue 7 years ago • 6 comments

The default rendering of reference_many is appropriate for things like tags and categories. In my use case, the user experience should be the same as for referenced_list, even though the relationship is held in the opposite (reference_many) direction. I'd like to see a list view even if only showing a single target field (although the option of multi column with several target fields just like referenced_list would be even better).

Probably this is possible now or an enhancement that could be added, but I haven't been able to work out how yet. Guidance gratefully received.

garethsb-ghost avatar Mar 05 '17 11:03 garethsb-ghost

You could try with a template or by using a custom type

Phocea avatar Mar 16 '17 08:03 Phocea

Hello,

As explained in the README, the GitHub issue tracker is for bugs and enhancement requests. So I close this issue, but feel free to write a question on StackOverflow with the tag ng-admin.

Thanks for using ng-admin!

Kmaschta avatar Mar 30 '17 09:03 Kmaschta

I considered this an enhancement request. Maybe I haven't investigated enough but as a new user who read through all the docs and examples and browsed the implementation, I couldn't see how this could be achieved.

garethsb-ghost avatar Mar 30 '17 09:03 garethsb-ghost

My bad! I open it again.

Kmaschta avatar Mar 30 '17 09:03 Kmaschta

Thank you, @Kmaschta. If there's a simple way to achieve this, I'd love to know and it'd make a good example in the docs. :-)

garethsb-ghost avatar Mar 30 '17 09:03 garethsb-ghost

If you want to write a PR, I suggest you to add an option to the ReferenceManyField to display something else than a ChoiceField (which is a ui-select).

Otherwise, the only way to change the reference_many is to write a custom type (as suggested by Phocea).

Kmaschta avatar Mar 30 '17 09:03 Kmaschta