Wes Gamble wrote:
> I've added a "column" to config.columns which relies on a method on my 
> model to generate it's value - meaning that it isn't a regular attribute 
> of the model.
>
> When the list view renders, this "calculated" (or whatever we should 
> call it) column is not rendered in a way that allows for sorting.
>
> But this statement in the List API documentation implies that I should 
> be able to sort on this column:
>
> "The sorting names here refer to columns in config.columns, and when 
> ActiveScaffold tries to actually perform the sorting it will check the 
> column configuration to see whether to use method sorting or sql sorting."
>
> Do I have to do anything else to get sorting on this column to work?
>
>   

I didn't read your question fully, but yes you can sort on a calculated
column.  Either you set the sort SQL which is most efficient, or you can
use sorting where the whole recordset is read into memory and sorted
locally (more expensive usually)

If in doubt have a peek at the code - I had to have a look recently to
debug what was happening sorting multiple columns - it's fairly obvious

Ed W

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