I assume once you've reloaded the fragment, you have a script in there
that registers all elements as droppables again.  What of the former
droppable elements?

I assumed that in the .rjs template the page.replace_html.... code
would handle this.  There are 2 partials. One has all the draggable
items, and the other consists of drop_receiving_elements .  when a
draggable lands in one, it calls an action in the controller, adding
some data depending on which element it was dropped in to. The .rjs
replaces the div that contains that partial. The items in the drop
receiving elements are not draggables.  I set up the drop receiving
elements in the partial.  Here's the partial that I'm replacing.
Again, this seems to be an IE 7 thing, it behaves fine in Firefox and
opera (even if the items in the droppables are made draggable!) :


This week began on: <%= (pass_monday(Date.today)).to_s %>

<table class="goaltbl" width ="100%" height= "30%" border="1">

<tr height = "10%">
<%0.upto(6) do |x|%>
   <th class="goaltbl" width ="14.2%" > <%= (@start_of_week +
x).strftime("%m/%d/%Y")%> </th>
<%end%>
</tr>

<tr>

<%0.upto(6) do |x|%>
   <td width ="14.2%" >
   <div class="goaltbl" id= "planned_goals<%=x.to_s%>" >

   <ul id="planned_goal_list">
     <%goal_list_by_date (@start_of_week + x) %>
     <%for goal in @scheduled_goals%>
           <% domid = "goal_#{goal.id}" %>
           <li style="background-color: <%=h(goal.role.color)%>"
class="available_goal" id="<%= domid%>">
           <% form_for :goal, goal do |f|%>
                       <%= f.check_box :completed, :onclick=>
remote_function(:url => {:action=>"goal_check",
                                                        :id=> goal.id,
                                                        :completed=>
goal.completed},
                                                        :method =>
:post,
                                                        :before =>
"$('spinner').show();" ,
                                                        :complete =>
"$('spinner').hide();")
            %>

           <% end %>
          <%=goal.summary%>

          </li>

       <%end%>
   </ul>

   </div>
   </td>

<%end%>

</tr>
</table>
<%0.upto(6) do |x|%>
<%= drop_receiving_element("planned_goals#{x.to_s}",
       #:update => "goal_table",
       :accept => 'available_goal',
       :before => "$('spinner').show();" ,
       :complete => "$('spinner').hide();" ,
       :hoverclass => 'hover',
       :with => "'goal=' +
encodeURIComponent(element.id.split('_').last())" ,
       :url => {:controller=> "schedule", :action=>"goal_planned",
                 :the_day=> x })%>
<%end%>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to