Michael Price wrote:
Hi,
Say I've got this list:
<ul id="sortable">
<li id="element1">stuff</li>
<li id="element2">stuff</li>
<li id="element3">stuff</li>
</ul>
Using Interface sortables I want to get a comma separated list of list
item IDs after I've done some dragging. Say I've been doing some
dragging and it's now:
<ul id="sortable">
<li id="element3">stuff</li>
<li id="element1">stuff</li>
<li id="element2">stuff</li>
</ul>
I can use SortSerialize but this gives me the POST-ready version. I
just need "element3,element1,element2".
What is the best way to achieve this?
Regards,
Michael Price
var listIds = $("#sortable li").attr("id");
listIds.join(",");
Is how I'd do it. Whether it'll work or not I don't know...