views:

26

answers:

1

I wish to create a custom helper based on the element being dragged. I'm dragging documents and I'd like the document's number to be part of the custom helper.

I know how to create a helper during init like this:

helper: function()
        {
            return $("<div class='fax16'></div>");
        }

But what I really want to do is maybe in response to the start event get access to the element being dragged and use some of its properties to set the helper.

Something like:

start: function(event, ui)
{
   var docID = //somehow access the dragged element
   ui.helper = $("<div class='save16'>" + docID + "</div>");  //Set drag Helper    
}

Can this be done?

A: 

not sure but a have a feeling this is what you need.

start: function(event, ui)
{
   var docID = ui.find('.fax16'); //somehow access the dragged element
   //ui.helper = $("<div class='save16'>" + docID + "</div>");  //Set drag Helper    

}
Val