Hrm, so when putting this fix in place, it seems that when you perform
a nested drill down of any element, when you "close" that nested
table, the parent row somehow gets their "even-record" status
removed... is this a bug??

-- Darien

On Apr 30, 6:20 pm, dkindlund <[email protected]> wrote:
> So it looks like I can fix this problem, by copying the
> _list_record.html.erb file to my app/views/active_scaffold_overrides/
> directory, and then modifying the lines:
>
> tr_class = cycle("", "even-record")
> tr_class += " #{list_row_class(record)}" if
> respond_to? :list_row_class
>
> to be:
>
> tr_class = cycle("", "even-record-")
> tr_class += "#{list_row_class(record)}" if respond_to? :list_row_class
>
> At which point, we can reference even rows via:
>
> tr.even-record-status_1
>
> Please let me know if this is the recommend solution, or if there's
> another support method.
> -- Darien
>
> On Apr 30, 1:07 pm, dkindlund <[email protected]> wrote:
>
> > So, I'm trying to override the default background color of a column,
> > but have that color be different depending on if the column is odd or
> > even.
>
> > I start by creating list_row_class, as follows:
>
> > module ClientsHelper
> >   def list_row_class(record)
> >     if record.is_a?(Client)
> >       return record.client_status.status
> >     end
> >   end
> > end
>
> > Now, I notice that this adds the following class to the rows:
> > <tr id="clients-list-18353-row" class="record status_1">
> > <tr id="clients-list-18315-row" class="record even-record status_1">
>
> > In by CSS override file, I've declared the colors as follows:
> > .active-scaffold tr[class="record status_1"] td.client_status-column {
> > background-color: #FFEE00;}
>
> > .active-scaffold tr[class="record status_1"] td.client_status-column
> > a.disabled {
> > color: black;
> > font-weight: bold;}
>
> > .active-scaffold tr[class="record even-record status_1"]
> > td.client_status-column {
> > background-color: #FFFF88;}
>
> > .active-scaffold tr[class="record even-record status_1"]
> > td.client_status-column a.disabled {
> > color: black;
> > font-weight: bold;
>
> > }
>
> > This CSS works fine... until I render a nested form, in which case,
> > ALL these customizations are lost.  I believe the core problem is that
> > I'm using:
> > tr[class="record status_1"]
> > instead of:
> > tr.status_1
>
> > AND
> > tr[class="record even-record status_1"]
> > instead of:
> > ??? - I have no idea what I can use here... tr."even-record status_1"
> > doesn't work... how can I logically AND together the presence of two
> > class types?
>
> > Any help would be useful.
> > -- Darien
--~--~---------~--~----~------------~-------~--~----~
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