Currently, the Field_collection module implements item weights using deltas, which to my understanding, is incorrect.
Part of this problem stems from the fact that field_collection items are loaded from the field_collection_item table instead of the field that it references.

Deltas are supposed to reference nothing more than the fact that more than one field instance exists.

For instance: I have a Profile2 field-collection called "Education". The source entity allows unlimited data in this field. The collection-item entity has several fields attached to it.

I noticed the .install doesn't provide a "weight" field for the field_collection_item. It also seems like this module removes all field-collection values for the present entity and re-inserts them using their "delta" as the order.

The reason this problem starts to crop up in views, is that the "delta" is a "field", not a pseudo-field like weights. So, when the view processes, "delta" is selected as data, and Views tries to use the field alias to handle sorting. The net effect is that Views selects delta information when it shouldn't be, and the items pulled from the DB don't match our expected results.

Comments

Also looking for this feature.

Title:Views support: Sorting collection items is brokenViews: Field Collection Item weights not available for sorting
Category:bug» feature

Changed some of the issue information so that its more descriptive

I need this feature as well.

Yes it looks like it's using delta, thus when items are removed or on edit, it looks like the array of field collection items is just reordered. I can see why they would do it this way (a very simple approach) but it makes views handlers very tricky.

Possibly, one could write a views handler that uses the delta and the host entity information to determine a 'weight' for any field collection item using one of the existing functions.

I think instead of creating a new way to accomplish an existing task, we should fix field collection by adding weights in addition to delta.

Yeh I would really find having weights very useful. It would allow me to integrate into draggableviews

so... there is no way to use views to print out items of a field collection in the order that they appear?

I did a view like this and found out an explanation:

In the database there is no weight stored, only the delta which is used to indicate the order of the elements.

So if you need to sort the field_collection items in your views' result by the order they are set, you'll need to use the delta as you'd use the weight.

#8 worked for me. Thanks for the tip @milanith

Hi milanith and CarbonPig - I'm feeling quite daft - but where did you find the delta field?
I have a view that just displays the content of a field collection (no other related data). But I cant find a way to display the view in the same order as they are set.
I've resorted to added a an extra "sort order" integer field on the field collection.

I have just provided a comment to a similar question in the Field Collection Views module here

In this way no extra sort order fields are necessary.. just a required relationship to the parent entity.

Hope this can help you out.