That's what I just discovered... !!

the checking ("may I drop this item into you?) has to be done by the
server...
so I'll have to perform in my server url action   I have in my
receiving droppable area

:url => add_work_tours_url(:user_id => user[:id]),

check  and if not accepted revert it ...




On 16 sep, 16:09, bluezehn <[EMAIL PROTECTED]> wrote:
> Well you may have a small problem there... AJAX requests are, as their
> name dictates, asynchronous. That is, prototype will fire one off, but
> won't sit around waiting for the server. It will move on and execute
> the next line of code, then go back to the onComplete callback.
>
> This is problematic for returning a value inside the onComplete
> callback because the revert function's execution might have already
> finished.
>
> Furthermore you may have a problem in that you'll have a draggable
> sitting there in the middle of the screen waiting for an ajax request
> to tell it whether or not it needs to revert. If this is more than a
> second or so it's going to seriously confuse the user when it reverts
> back across the screen.
>
> I'd suggest loading into JS on page load all the different rules as to
> which draggables can be dropped where, then checking each of these in
> the function you specify in revert.
>
> On Sep 16, 2:47 pm, Erwin <[EMAIL PROTECTED]> wrote:
>
> > yes, that's right.. I can make an Ajax request to the server, return
> > would be true or false if drop is accepted ..   good I am going to try
> > it
>
> > was not sure about the different callback timings  , thanks a lot
>
> > On 16 sep, 13:22, bluezehn <[EMAIL PROTECTED]> wrote:
>
> > > revert           1.5     boolean or function reference, defaults to false.
> > > Revert can also be an arbitrary function reference, called when the
> > > drag ends. Specifying ‘failure’ will instruct the draggable not to
> > > revert if successfully dropped in a droppable.
>
> > > From draggable api. So you can set revert to be a function which
> > > decides whether or not to revert the draggable to its starting
> > > position. Is this what you meant?
>
> > > On Sep 16, 11:34 am, Erwin <[EMAIL PROTECTED]> wrote:
>
> > > > I would like to check if dragging an item in a droppable zone is
> > > > allowed and refuse the drop if not...
> > > > when should I fire the checking action ?
>
> > > > should I check in the url action ?  or use one of the callbacks
> > > > onDrop
>
> > > > thanks for your suggestions
>
> > > > erwin
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to