On Sábado, 9 de Enero de 2010 00:43:19 mobilemike escribió:
> I have a very wide table (around 50 columns with more looming every
> day) and I currently only show a very smal subset in the list view. I
> use AS to display data to end users, not for an admin interface. My
> user community is clambering for access to different views on the
> data; lists that show different subsets of columns based on tasks.
>
> I've had a lot of success using a before_filter to filter the rows
> returned, but column filtering seems really hard right in AS. In this
> post,
> http://groups.google.com/group/activescaffold/browse_thread/thread/bb6f7f1c
>35834d49/6933e0463a73785d?lnk=gst&q=columns#6933e0463a73785d, there's a
> snippet of code that can recursively exclude columns. I
> supposed this code could be used to also add them, but it seems like
> an awful lot of overhead.
>
>   active_scaffold_config.list.columns.each { |col|
> active_scaffold_config.list.columns.exclude col.name }
>
> I can see my app ending up with 10 or so views, and it would be much
> simpler (and DRYer I think) to just explicitly set the columns
> necessary for each of these views using a case statement. Has anyone
> succeeded in doing this? Is there already a simple feature for doing
> this that I'm overlooking?

Have you tried to set list.columns to the array columns you need?
active_scaffold_config.list.columns = [:col1, :col2, ...]
Maybe you need to call 
active_scaffold_config.list.columns.set_columns(active_scaffold_config.columns) 
after set list columns


-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
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