If you want to do somehting like alert('blah'); you must wrap it in an 
anonymous function like this...

onUpdate : function(event) {


Alex Mcauley
----- Original Message ----- 
From: "JoJo" <tokyot...@gmail.com>
To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
Sent: Sunday, August 16, 2009 7:50 AM
Subject: [Proto-Scripty] Re: Sortable onUpdate firing at the wrong time

I think I figured it out. The callback must not have parentheses.

FAIL:    onUpdate: someFunction();
GOOD: onUpdate: someFunction;

I have no idea why.  I am a beginner to JS.

On Aug 15, 11:17 pm, Mojito <tokyot...@gmail.com> wrote:
> Why is the onUpdate callback fired right when the Sortable is created
> and not when I move an <li>? This code also screws up my dropping - I
> am forced to click again to drop. Additionally, after dragging an
> <li>, it remains translucent even after dropping it.
> Sortable.create(
> 'lineup', {
> overlap: 'horizontal',
> constraint: 'horizontal',
> onUpdate: alert('onUpdate')
> }
> );
> <ul id="lineup">
> <li class="source" id="playlistItem_0">one</li>
> <li class="source" id="playlistItem_1">two</li>
> </ul>

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to