I’m using the rails sortable_element helper on a list and after it has
been sorted I have used this code:
page[‘page_’ + p.id.to_s].replace :partial => ‘page’, :locals =>
{ :page => p }
to replace the list items that changed order as the html has to
change.
The problem is that any of the list items that are ‘replaced’ are now
not sortable. Is this expected behavior and is there a fix or a
workaround?
my ‘hack’ doesn’t work too well, as it introduces loads of problems if
you then try to sort again as the array that is sent to the sort
action gets messed up…oh well, it seems that you can’t seem to do
any JS tricks with generated content.
my ‘hack’ doesn’t work too well, as it introduces loads
of problems if you then try to sort again as the array that
is sent to the sort action gets messed up…oh well, it
seems that you can’t seem to do any JS tricks with
generated content.
Have you tried just doing a replace_html on the
or
surrounding
your
s? I’ve just been fighting with something that may be related.
Haven had enough time to isolate the problem further, but when I render
a
partial with an observe_field in it 'normally, the shows up in
FireBug. When I render the same partial via RJS, it disappears. The
actions still fire, but I lose the debug ability I so_much rely on with
FireBug.
HTH,
Bill
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.