Awesome, this is my final solution that works great.  It unhilights
the previously highlighted row, and highlights the new one.

  page<<"$$('tr.quickview').invoke('removeClassName','quickview')"
  page<<"$('twonewlatestrides-list-#{params[:theid]}-row').addClassName
('quickview')"

Thanks for the tips!



On Feb 10, 9:14 pm, David Cato <[email protected]> wrote:
> [email protected] wrote ...
>
>
>
> > I have a view column with 2 links in it set by the helper as follows
>
> > def view_column(record)
> >          "#{link_to_remote image_tag('2/quickview.gif') , :url =>
> > { :controller => 'twonewlatestrides', :action =>
> > 'quickview', :theid=>record.id, :athleteid => record.athlete_id}} #
> > {link_to image_tag('2/detailedview.gif'), :controller =>
> > 'twonewlatestrides', :action => 'show', :id=>record.id}"
> >        end
>
> > in my views/twonewlatestrides/quickview.rjs   I have
>
> > page<<"$('twonewlatestrides-show-#{params[:theid]}-
> > link').style.background='#0000FF'"
>
> > so, when the table is pulled up, I have an icon, that when clicked,
> > I'd like it to highlight the row the icon is in.
>
> > I have other various components in the quickview.rjs file that updates
> > other parts of the page based on the record being clicked.
>
> Seems to me that you ought to be able to (1) define the following CSS to
> override the default
>
>   .active-scaffold tr.quickview td {
>     background-color: #0000ff;
>     /* Plus any other appropriate changes */
>   }
>
> (2) change quickview.rjs to
>
>   
> page<<"$('twonewlatestrides-show-#{params[:theid]}-link').addClassName('quickview')
>
> and (3) wherever you reset the the background do the reverse, i.e.,
>
>   
> page<<"$('twonewlatestrides-show-#{params[:theid]}-link').removeClassName('quickview')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to