/    Sign up×
Community /Pin to ProfileBookmark

Drag/Drop Serialize?

I’m experienced with using Prototype/Script.aculo.us for AJAX and combo effects, but haven’t done much with drag/drop. I have the actual drag/drop functionality working well, but would like to know how to actually get the information about the dropped items. I know with Sortables, there is a serialize function, but it doesn’t appear that this is true for Droppables.

I’ve tried Googling it, but no luck. I didn’t have any luck finding it in my “Practical Prototype and Script.aculo.us” book either, so hopefully somebody can give me somewhere to go with it.

FYI – I’m dragging and dropping list items, and would like to get the ID of the list items and/or their values.

I did write this, but can’t seem to get it into an array or other usable form to send back to the server…

[CODE]$(‘dropzone’).select(‘li’).each( function(li) {
alert($(li).readAttribute(‘id’)); });[/CODE]

Thanks!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@kawzakiJun 11.2009 — i registered to answer your question.. lol

to access the id of each elements

$('dropzone').select('li').each( function([B]li[/B]) {

alert([B]li[/B].id ) });


but i wonder if you were able to select moving some items from the list.
×

Success!

Help @phpfreak spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...