Skip to content

allow more fine-grained control of destroy strategy #858

Open
@donalmurtagh

Description

@donalmurtagh

Currently, the destroy strategy for conditional fields can only be specified at the form level, but it would be useful if you could have different strategies for different fields.

In our case, we use conditions to implement pagination-like behavior:

    {
      type: 'section',
      condition: 'model.page === 1',
      items: [
        'field1',
        'field2'
      ]
    },
    {
      type: 'section',
      condition: 'model.page === 2',
      items: [
        'field3',
        'field4'
      ]
    }

At the bottom of the form there are previous/next buttons which update the value of model.page. Obviously we never want to remove the data when the users moves to a different page, so we have to use a form-wide destroy strategy of retain.

What we like to be able to do is use a retain destroy strategy for the page conditions and a remove destroy strategy for the fields within the pages.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions