Kdyby / FormsReplicator

Other
30 stars 58 forks source link

Reverse rendering & fillig of items #26

Open ghost opened 10 years ago

ghost commented 10 years ago

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.

fprochazka commented 10 years ago

It could be done using $insertBefore http://api.kdyby.org/class-Nette.ComponentModel.Container.html#_addComponent

ghost commented 10 years ago

But how? I did not see it in your code.

fprochazka commented 10 years ago

No it isn't, my comment was just a note for anyone who'd like to implement it ;)