Comments

Yuri’s picture

Does indeed not work with field collections.
Please add support for this, since field collections are becoming very popular.

krlucas’s picture

Title: Field Collection ?? » Add support for Field Collections
Category: support » feature

Changing Category to Feature Request. And just to be clear, Yuri, you are asking for integration with http://drupal.org/project/field_collection ?

Yuri’s picture

Yes, that's correct.

tanc’s picture

Adding my voice to the request. Would be great to see integration.

micheas’s picture

Strange, it seems to more or less work for me with field collections.

seemas’s picture

micheas, what version are you using?
Thanks

micheas’s picture

seemas: dev checked out of git.

Nick Robillard’s picture

StatusFileSize
new89.25 KB

Glad to see others are interested in this too. Initially Field Collections may appear to work but headers are missing (when using Field Collection Table) and empty rows / Javascript errors occur once you click Add Another Item and then try to drag a row.

As the screenshot shows, when using the Embedded widget with Editable formatter, the header row does not have any data and when Add Another Item is triggered, blank rows are inserted and dragging produces the Javascript error: "TypeError: rowSettings is undefined" tabledrag.js line 689.

I'm about to dive into code and will post my solution. If anyone has got this working or has made any progress, please share!

UPDATE: The Javascript errors were the fault of Field Collection Table. There are still element visibility JS issues but they relatively simple. Patch coming.

Nick Robillard’s picture

Status: Active » Needs work
StatusFileSize
new1.31 KB

With this change, I have Field Collections working nicely. Yay! Without this, Add, Remove and Add Another Item links are hidden when they should not be.

A few notes.

Field Collections bring up some UX issues. One example - if you modify a textarea and the next action is clicking on a radio button (so the 2 change events are fired nearly simultaneously), the second action does not "get caught" and the last selection reverts to its previous state. I fixed this particular issue by adding a 100ms timeout to the save action (not included in the patch). There are other cases, such as moving from a textarea to a select. Upon clicking select, the textarea save is triggered, and the select element suddenly deselects. Minor things - but bad UX nonetheless.

dreamer777’s picture

Issue summary: View changes

I try to implement editablefields for field collection and found this article
http://alexrayu.com/blog/saveupdate-field-collection-without-nodesave

Are there any ideas how to update the field collection item without re-saving the whole node?
I will appreciate your help!

SRizo’s picture

Here is a new patch for field collection. Added a new class for triggerHandler, otherwise ajax doesn't save the chaged.

osopolar’s picture

If there are multiple submit buttons i.e. the remove or the add another item buttons for field-collection fields where all of them have the same css class form-submit ajax subission (javascript change event) seems to trigger the remove button and/or the add another item button, so the field collection items where not saved.

Using a different class for the save button as in #11 will fix the problem.