After further investigation, it looks like there was a bug in the
partial row rendering, which made it impossible to recover an "even or
odd-specific" row class (tr class) after closing a sub nested table.
I've been able to fix the problem and have provided a basic patch
below. Just to a search for 'tr_class' in the code below, and you'll
see all the changes from the master branch:
vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb:29
--------------
def row
render :partial => 'list_record', :locals => {:record =>
find_if_allowed(params[:id], :read), :tr_class => para
ms[:tr_class]}
end
--------------
app/views/active_scaffold_overrides/_list_record.html.erb:
--------------
<%
record = list_record if list_record # compat with
render :partial :collection
dont_show_calculations ||= false
if defined?(tr_class).nil?
tr_class = cycle("", "even-record-")
tr_class += "#{list_row_class(record)}" if
respond_to? :list_row_class
end
url_options = params_for(:action => :list, :id => record.id)
-%>
<tr class="record <%= tr_class %>" id="<%= element_row_id(:action
=> :list, :id => record.id) %>">
<% active_scaffold_config.list.columns.each do |column| %>
<% column_value = get_column_value(record, column) -%>
<td class="<%= column_class(column, column_value) %>" >
<%= render_list_column(column_value, column, record) %>
</td>
<% end -%>
<% if active_scaffold_config.action_links.any? {|link| link.type
== :record } -%>
<td class="actions">
<%= render :partial => 'list_actions', :locals => {:record =>
record, :url_options => url_options} %>
</td>
<% end -%>
</tr>
<% target_id = element_row_id(:action => :list, :id => record.id) -%>
<script type="text/javascript">
actions = new ActiveScaffold.Actions.Record(
$$('#<%= target_id -%> a.action'),
$('<%= target_id -%>'),
$('<%= loading_indicator_id(:action => :record, :id => record.id) -
%>'),
{refresh_url: '<%= url_for params_for(:action => :row, :id =>
record.id, :_method => :get, :tr_class => tr_class, :escape => false) -
%>'}
);
<%= update_page do |page|
page.replace active_scaffold_calculations_id, :partial =>
'list_calculations'
end if not dont_show_calculations and
active_scaffold_config.list.columns.any? {|c| c.calculation?} %>
</script>
--------------
If possible, I'd ask if any AS developers could merge these changes
into the master branch, since it requires a change to the core AS
code.
Thanks,
-- Darien
On Apr 30, 6:27 pm, dkindlund <[email protected]> wrote:
> 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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---