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.





On Feb 10, 4:35 pm, Kenny Ortmann <[email protected]> wrote:
> when is the rjs being called?
>
> On Tue, Feb 10, 2009 at 3:27 PM, [email protected] <[email protected]>wrote:
>
>
>
> > The problem is that I don't want to update the row in any way, I just
> > want to indicate that that row is selected because other info on the
> > page reflects that selection.
>
> > there must be a way to hit a link and set the background color of row
> > the link was in to something else...
>
> > On Feb 10, 3:36 pm, David Cato <[email protected]> wrote:
> > > [email protected] wrote ...
>
> > > > any reason this wont work in rjs?  I've used this method to
> > > > dynamically highlight or change the background color of lots of table
> > > > cells and rows, but for some reason it isn't working with AS tables.
> > > > I'm passing the id as a paramter called theid, and the id of the TR
> > > > row is correct...
>
> > > > page<<"$('twonewlatestrides-list-#{params[:theid]}-
> > > > row').style.background='#ccffff'"
>
> > > I think your problem is that AS sets the background on the individual
> > > table cells ('.active-scaffold tr.record td' and variations), so setting
> > > the background on the row itself won't have any effect.
>
> > > You're probably better off defining a special class in your CSS to
> > > override the AS defaults, then update the row to add the special class
> > > name.
--~--~---------~--~----~------------~-------~--~----~
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