Open ghost opened 10 years ago
It could be done using $insertBefore
http://api.kdyby.org/class-Nette.ComponentModel.Container.html#_addComponent
But how? I did not see it in your code.
No it isn't, my comment was just a note for anyone who'd like to implement it ;)
Now if you hit button with ->addCreateOnClick() it add new empty field/fields on the end of replicator. Is it possible to add some "switch" like "$revert = FALSE" on this line https://github.com/Kdyby/Replicator/blob/master/src/Kdyby/Replicator/Container.php#L60?
When $rever will be TRUE it add items on the start of replicator (array of replicator components).
The current behavior is a problem if you have multiple items. You must scroll to the end of page after every click on button.
I hope that you understand.