El Thursday 30 October 2008 20:48:13 Wes Gamble escribió: > The heading on the column isn't even a link. So first I need to figure > out how to render the heading correctly, and then I can worry about how > the actual sort is done on the back end.
A virtual column won't have a sort link until sort method is set: if activescaffold doesn't know how to sort, doesn't put a link to sort. Look at sort and sort_by in API:Column > > Ed W wrote: > > 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 > > -- Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::. Nicolás Guillén 6, locales 2 y 3. 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 -~----------~----~----~----~------~----~------~--~---
