Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #3000 (new enhancement)

Opened 2 years ago

Last modified 2 years ago

Pass 'accept' option through a Sortable to the contained droppable

Reported by: peter.wagener@hypoluxo.com Assigned to: thomas@fesch.at
Priority: normal Milestone: 2.x
Component: script.aculo.us Version: 0.14.3
Severity: normal Keywords: Sortables Droppables
Cc:

Description

I'd like the ability to provide 'accept: someCssClass' to a Sortable.create(...) call and have the resultant sortable only accept elements of the specified CSS class.

I've made some simple tweaks to dragdrop.js 1.5RC5 (essentially adding "accept" as a pass-thru from Sortable.create(...) to the contained droppables). The result works for the simple case, but this case does not work:

  1. There are two lists (List A and B)
  2. List A contains elements with the CSS class "lower" and "capital"
  3. List B will only accept "capital" elements.
  4. Drag a "capital" element from A to B, which is correctly accepted
  5. Drag a "lower" element from A to B, and we see trouble. The droppables around the original List B elements won't accept it, but the droppables surrounding the element dropped in step 4 will still accept it.

The droppables on the originally-dropped element obviously don't get modified with their new 'accept' option. If there is an acceptable way to do this outside of script.aculo.us, please let me know.

Change History

11/24/05 05:48:54 changed by bitsweat

  • owner changed from Rails to madrobby.
  • version set to 0.14.3.
  • milestone set to 1.x.

02/01/06 02:11:45 changed by peter michaux

Patch submitted for the accept issue.

The other parts of the example in the ticket is a matter of homogenizing the draggabble and droppables in list B.