1

I have a ui draggable that connects to a sortable list with helper clone.

$(".mydrag").draggable({
                helper:'clone',
                handle: '.drag',
                connectToSortable:'.new',
                start: function(event, ui) { console.log(ui);
                    var id = ui.helper[0].id;

                    $(ui.helper).attr("id","new-"+id);

                }


            });

When start the drag I and a prefix of "new-" at the id expecting that when received by the sortable will sit as new-id. But its not working.

I also tried to change the context

$(ui.helper.context).attr("id","new-"+id);

but in this case change the id of the received element in the sortable BUT it also change the id of the original item

I also tried to change the id when sortable receives the new element but change the id of the original item (because when receiving there are 2 elements with the same id)

So I am really stuck. Any help appreciated

bpeterson76
  • 12,918
  • 5
  • 49
  • 82
ntan
  • 2,195
  • 7
  • 35
  • 56
  • @Michael, did you read this when you got the privilege to edit posts? http://stackoverflow.com/privileges/edit – Mischa Oct 27 '10 at 11:48
  • You must have missed this part: "Try to make the post substantively better when you edit, not just change a single character. Tiny, trivial edits are discouraged." – Mischa Oct 27 '10 at 11:51

0 Answers0