Take the 2-minute tour ×

I have two drag and drop lists as follows. I would also like the ability to add a double click event that switches items between lists as well. Following is my sortable code.

  connectWith: '.available_product_shipments'
  appendTo: 'body'
  helper: 'clone'
  dropOnEmpty: true

  connectWith: '.product_shipments'
  appendTo: 'body'
  helper: 'clone'
  dropOnEmpty: true

Not sure where to start with regards to adding double click functionality as well. this is what I have so far. The following code does fire the event, but does not move the list item. to the other ul element. One thing that may be messing things up is that .available_product_li is a sub list of .available_product_shipments. any clues?

$(".available_product_li").delegate "li", "dblclick", ->
  $(".available_product_li li.clicked").removeClass("clicked").appendTo "body"
$("#product_shipments").delegate "li", "dblclick", ->
  $("#product_shipments li.clicked").removeClass("clicked").appendTo ".available_product_li"
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

It was as simple as this.

$(".available_product_shipments").on "dblclick", ".product", ->
  $(this).appendTo ".product_shipments"
$(".product_shipments").on "dblclick", ".product", ->
  $(this).appendTo ".available_product_shipments"
share|improve this answer
add comment

Your Answer


