Forum: Ruby on Rails sortable_element -- need a strategy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
861b0f573f69e2d9e834a3e75c8df408?d=identicon&s=25 charlie caroff (Guest)
on 2007-06-22 00:36
(Received via mailing list)
Hi,

I have listings that are numbered.  When I re-sort them, the first
page of results re-sorts fine in the database, but the second page is
ignored.  How do I renumber all listings?

Also, though the first page is re-sorted fine in the database,
listings numbers do not update on the page.  I'm inclined to have
an .rjs file that does a replace_html on all listings, but it would be
so much less data simply to have the listing numbers update.

Here is my code.  The :after part is not working.  redraw_listings is
an rjs that replaces all listings with the partial that creates them.

<%= sortable_element('listing', :tag => "div", :constraint =>
false, :scroll => :window,
:url => { :action => "sort_by_position" , :id =>
@search_term.id }, :containment => ['listing'], :after => { :action =>
'redraw_listings'} ) %>

Any hints?

Thanks,

Charlie
This topic is locked and can not be replied to.