Pass id through to child list items, and iterate index for each item.#393
Pass id through to child list items, and iterate index for each item.#393rjmackay wants to merge 1 commit intopowmedia:masterfrom
Conversation
|
+1 |
|
I haven't explicitly tested it, but I think that this has problems with lists that are meant to be sorted or re-ordered, such as this plugin If you have 4 items such as this:
and you move the last item to the front of the array
Your ids (wth the implied order because you're using the length attribute for id) are now confusing. Even worse, if you now remove the last item
but then add a new one
We have duplicate IDs. I do not think items.length should be used to generate the id. Instead, I would recommend using the view's cid attribute. Is there a specific reason you needed the index in the id string? If so, is there a reason you can't index the item against list.items? |
Making it easier to work with list items by giving them unique ids.