sortable lists and an intransigent dropOnEmpty

I spent a good deal of today banging my head against some scriptaculous sortable lists thingies to no avail. I seemed to have hit this snag where if I have a sortable list that either starts or later becomes empty, I can no longer drag anything to it. This makes me sad. Naturally I cannot share my sadness with the scriptaculous sortable lists demo because theirs works just fine. Before I caught the bus I spent a few fleeting moments inside of firebug to no avail. Web shit sucks.

I guess I’m not the only one, however, who has found that sortable dropOnEmpty isn’t behaving itself. As soon as I find the answer, which is no doubt me being somehow ignorant, I shall certainly spread the word.

Alas, my ongoing battle with Ruby and Rails will continue on the morrow.

Update: I’m not exactly sure of anything I did in particular, but this problem somehow solved itself. Here’s the relevant scriptaculous code in my previously won’t-droponempty view.

<p id="available_members_list"></p>
<p id="current_members_list"></p>
<input type="hidden" id="sortable_hidden" name="sortable_hidden"/>
<%= sortable_element(:available_members, :update => 'available_members_list', :dropOnEmpty => true,
:containment => ['available_members','current_members'],
:complete => visual_effect(:highlight, 'available_members')) %>
<%= sortable_element(:current_members, :update => 'current_members_list', :dropOnEmpty => true,
:containment => ['current_members','available_members'],
:complete => visual_effect(:highlight, 'current_members'),
:url => {:action => 'order'}) %>

Comments

Leave a Reply