0

When creating or editing an entity, is it possible to have a second choices field where the options are dependent on the first choices field?

For example, I have categories and subcategories. The choices/options for the subcategory field are dependent on the currently selected choice/option in the category field.

In the docs, there is an example with categories and subcategories but when I attempt to do it the way shown, the subcategories only get updated on the page load and do not change when a different category is specified. You can find the example through the link below. https://github.com/marmelab/ng-admin/blob/master/doc/reference/Field.md#-reference-field-type

Matt T
  • 3
  • 1
  • 2

1 Answers1

0

The only way to have a dynamic choice field si to write a new custom directive and use it as a template as your field.

nga.field('my_field')
    .template('<my-custom-field field="::field" values="::entry.values"></my-custom-field>'),
Kmaschta
  • 2,369
  • 1
  • 18
  • 36