You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer, I would like to be able to set a destroyStrategy for array form types, so that when I remove an item, I can have it empty instead of destroyed (to keep track of changes).
Expected behaviour
I expected destroyStrategy to work on array form types.
Actual behaviour
It actually does not work like that. Nor does it provide any means of intercepting the remove item event.
Hi @andrei-dracea when I click remove on the array item the comments array is showing as an empty array, what were you hoping it would show?
Are you wanting the array item itself to remain? That could be achieved with a button hiding the item rather than removing it, the default array buttons delete the array item so there is no item for ASF to act upon. If the array included a section with a condition you could show and hide items within the array by setting a property not in the schema.
I would expect a better method to keep track of removed items would be to have your own button that moves the item to another array.
So, when you click remove, I was hoping there was a way I could specify something like destroyStrategy: "empty", so that I could have the order of the items remain the same, when I already have some data into the form.
I still need the form item to disappear, but the array item to remain (see bellow).
For the comments array example, starting from this model:
So what you are saying is that I should disable the default remove button and generate my own, with custom actions? Is there a way to override the default action?
Enhancement
As a developer, I would like to be able to set a
destroyStrategy
for array form types, so that when I remove an item, I can have it empty instead of destroyed (to keep track of changes).Expected behaviour
I expected
destroyStrategy
to work on array form types.Actual behaviour
It actually does not work like that. Nor does it provide any means of intercepting the remove item event.
Gist/Plunker/Demo
You can check in the
Array
section of the demo.http://schemaform.io/examples/bootstrap-example.html
Thanks!
The text was updated successfully, but these errors were encountered: