is it possible to save the draggableviews order back to the Field collection item ID

I want to rearrange the field collection items with draggableviews but at the moment the new order is only visible in the view itself not when i edit the entity where the field collection is

thanks a lot for helping!

Comments

istryker’s picture

Status Update:

@drupalok. I don't this you can do it. Atleast with the latest dev and native handler. Its something I will be working on. Along with Entity Reference. You might be able to do it now with FieldAPI handler. Also #1851752: Drag handler for saving weight into any column in any base table patch looks promising as it can sort any entities.

This is something I will be trying to iron out in the next 2 weeks.

drupalok’s picture

Thanks a lot for the quick response. Looking forward to that feature. Actually i think your module has so many more usecases... There is still a huge potential
Great work istriker, keep it up!

klonos’s picture

Title: save to Field collection item ID » Save to Field Collection item ID

...

istryker’s picture

albertski’s picture

My plan was to force my custom class to be used instead of draggableviews_handler_field_draggable. Hopefully, it would be possible with hook_views_data_alter but didn't worry about that for now. My class would extend draggableviews_handler_field_draggable but all it would do is update $this->field_alias to use my field collection column instead of nid (of course there would need to be some logic to only specify which view).

As a quick test I added $this->field_alias = 'field_collection_item_field_data_field_style_image_coll_item'; in draggableviews_handler_field_draggable::views_form() and I did get the field collection id to save in the draggableviews_structure table. The only problem was that I could not get it to display in the correct order. Couldn't figure out but it probably is something with the draggable_views_join_handler.

Long story short I could not get it to work. If anyone has some ideas let me know.