Hi, I'm having problems with a call back, the following code doesn't
seem to want to call the callback function. I'm hoping someone can
help with this as the official scriptaculous documentation is pretty
poor.
Thanks
Sortable.create("list", {dropOnEmpty:true,handle:'handle',containment:
["list"],constraint:false, onUpdate:updateOrder});
function updateOrder(){
var options = {
method : 'get',
parameters : Sortable.serialize('list')
};
new Ajax.Request('saveOrder.php', options);
}
On Jun 25, 5:14 pm, "Jason Bunting" <[EMAIL PROTECTED]>
wrote:
> Arnar -
>
> Thank you for taking time to address my issue, I really do appreciate it!
> Yes, the documentation isn't very clear on the requirement of having the id
> look a certain way - I suppose if you stare at it long enough it could be
> inferred from the docs, but for someone using it for the first time it seems
> a bit cryptic; once one has knowledge of how it works, the docs seem to more
> clearly allude to the need for it.
>
> Thanks again!
>
> Jason
>
>
>
> > -----Original Message-----
> > From: [email protected] [mailto:[EMAIL PROTECTED] On
> > Behalf Of Arnar Birgisson
> > Sent: Monday, June 25, 2007 8:31 AM
> > To: Jason Bunting
> > Cc: JasonBunting; MochiKit
> > Subject: [mochikit] Re: onUpdate doesn't work for Sortable?
>
> > 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
>
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.472 / Virus Database: 269.9.6/865 - Release Date: 6/24/2007
> > 8:33 AM
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.472 / Virus Database: 269.9.6/865 - Release Date: 6/24/2007
> 8:33 AM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---