Thanks Eric,

Your reploy prompted me to look a little closer at the existing docs at
this URL:
http://wiki.script.aculo.us/scriptaculous/show/Sortable.create

There's a note to the effect that it can be made to work using TBODY as the
container and TRs as the sortable. It seems to be working, at least in this
simple example:

<table width="100%" class="separatedSM">
<tbody id="firstlist">
      <tr class="RowOne">
            <td>Row 1</td>
      </tr>
      <tr class="RowTwo">
            <td>Row 2</td>
      </tr>
      <tr class="RowOne">
            <td>Row 3</td>
      </tr>
      <tr class="RowTwo">
            <td>Row 4</td>
      </tr>
</tbody>
</table>

 <script type="text/javascript">
 // <![CDATA[
   Sortable.create("firstlist",
     {tag: "TR", dropOnEmpty:true, containment: ["firstlist"], constraint:
false});
 // ]]>
 </script>

Jeff Rankin
Human Factors
544-4333


                                                                                
                                                        
                      Eric Anderson <[EMAIL PROTECTED]>                         
                                                            
                      Sent by:                                 To:       
[email protected]                           
                      [EMAIL PROTECTED]        cc:       (bcc: William J. 
Rankin/UPC)                                   
                      onrails.org                              Subject:  
[Rails-spinoffs] Re: Sortable table rows instead of list       
                                                                items?          
                                                        
                                                                                
                                                        
                      06/08/2006 02:17 PM                                       
                                                        
                      Please respond to rails-spinoffs                          
                                                        
                                                                                
                                                        
                                                                                
                                                        




[EMAIL PROTECTED] wrote:
> Hi, I'm wondering if it's possible to create a table with sortable rows.
[...snipped details...]
>  <script type="text/javascript">
>  // <![CDATA[
>    Sortable.create("firstlist",
>      {dropOnEmpty:true,containment:["firstlist"],constraint:false});
>  // ]]>
>  </script>

You can sort with other items besides a list but you must specify the
tag of the items to be made sortable if you do. This is the "tag" option
and should probably be set to "tr".

That being said I believe there are browser issues with sorting tables
(I think specific to IE) so even with proper arguments it is not really
sortable (but other elements are and if you really wanted a
cross-browser table you could simulate it with <div> tags or something).

Eric

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs



_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to