Sorting views of a CollectionType based on a position field
I have a BookEntity (Name,Descript, ...) with a OneToMany relations to
TagEntity(name, position)
A tag is linked to only one BookEntity and a BookEntity can have multiple
Tags, but can also keep the Tags sorted in an explicit order.
For that I'm using an Drag&Drop javascript plugin in order to set a input
field hidden into the TagType I have embed
$builder->add('tags','collection', array(
'type' => new TagType(),
'allow_add' => true,
'by_reference' => false,
'prototype' => true,
'allow_delete' => true));
I can add new Tag using prototype.
but I have existing tags, and I'm going into the Edit page of a BookType.
How can i specify the order of the TagType ?
Thanks a lot
No comments:
Post a Comment