Closed gfaraj closed 10 years ago
g.last_row do |rec|
# return your html as a string
end
https://github.com/leikind/wice_grid/blob/rails3/lib/wice/grid_renderer.rb#L419
Was wondering if there was something that did it automatically, but that works. Thanks!
Wait... how would I retrieve the values to sum for a total?
how about using a variable in the block?
something like this
<% sum = 0%>
<% grid() do |g|
g.column do |rec|
sum += rec.something
rec.whatever
end
g.last_row do |rec|
'<tr><td>' + sum.to_s + '</td></tr>'
end
end %>
Oh, yeah that's a good idea. Thanks.
I would like to add a row at the end that shows a total for one or more columns. Is that possible?