Has anyone here ever run into the problem of having a list that cycles
a class name, in order for alternating lines to have a different
color, using the cycle() helper, but had it mess up when using the
prototype/ajax helper insert_html?
I''m trying to come up with a solution for this, and this is what I
have so far.
I''ve got a javascript that is included in the page:
Event.observe(window, ''load'', function(){
var alternateColor = function(){
$$(''li.item'').each(function(el, index){
if (index % 2)
el.addClassName(''alternate'');
});
};
alternateColor();
});
And in my form_remote_for, I use the callback "complete" like this:
form_remote_for(:model, :url => example_path, :complete =>
"alterateColor()") do |f|
The problem is, while the javascript works when reloading the page, it
fails to do anything after the form is submitted and the Ajax call is
made.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---