On Jun 3, 6:38 am, david <[email protected]> wrote:
> Hello,
>
> does anybody know the way to get the ui.helper once the sortable has
> received the element? That's, ui.helper inside the 'recieve' method in
> a sortable element?
> If you try to access the ui.helper element, you get undefined. You can
> manage to get the id of the element by getting ui.item.attr("id"), but
> not the element itself. If the element happens to be dragged several
> times into the sortable area, as they all are clones, they all have
> the same id, so you don't know which is the specific element that has
> just been recieved.
>
[snip]

Hello David,

I struggled for a while to figure out the behavior of sortables and
droppables... and it takes a little while to understand what's being
fired when. The best solution I think I can come up with is for you to
have an helper function, for example :

var _nextId = 0;
var _helperFn = function() {
   return $(this).clone().attr('id', $(this).attr('id') + (+
+_nextId));
};

thus creating clones with different ids. You may also set data
(clone.data(key, value);) to the clone to pass it from the source item
to the next item.

Good luck.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" 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/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to