Hi Jason,

On 6/25/07, Jason Bunting <[EMAIL PROTECTED]> wrote:
> Wow - either no one really knows how to help me or this list is even deader
> than I thought.

Sorry, I was hoping someone else would pick up on this since I've
never used Sortable myself.

I did some tests though and figured out how to use it.

The thing is that you need to give your options some id-s to identify
them. Their ids is what is used to detect their order, and if they
have no ids, no change in order is detected.

The format option to Sortable determines how the item "value" is
retreived from the element id. This option is a regular expression
whose first group is used as the id string. The default value searches
the element id up to the first _ character and takes whatever follows
as the "value".

To make your example work, you need to change the markus so:

<ul id="list">
    <li id="item_1">First</li>
    <li id="item_2">Second</li>
    <li id="item_3">Third</li>
</ul>

If you then call MochiKit.Sortable.sequence("list") - you can see how
the parts following the _ make up the object values, in this case it
returns "list[]=1&list[]=2&list[]=3".

If you want some other way of extracting the "value" from the <li>
id-s, you can pass a regexp to MochiKit.Sortable.create as the
"format" option.

I can agree that the docs are not very clear on this.

hth,
Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to