[Erp5-dev] listbox - sort by formatted column

bartek bartek at erp5.pl
Fri Jan 26 12:44:48 CET 2007


Jérôme Perrin wrote:
> Le Mercredi 24 Janvier 2007 23:20, bartek a écrit :
>> Hello
>>
>> What's The Right Way to display a formatted data (e.g. date) in a
>> listbox column and at the same time allow sorting by it?
>>
>> The best solution I could come up with was putting a script like
>> Base_formatCreationDate(brain, selection)
>> as a listbox column and then processing kw['sort_on'] in the listboxes
>> List Method to replace ('Base_formatCreationDate', 'ascending') with
>> ('creation_date', 'ascending').
> 
> Use an editable field listbox_creation_date, sorting and searching will then 
> use creation_date.

I tried this, but didn't know this:

> If you want to display a custom value, the brain for the current line is 
> "cell" in TALES context.

...and didn't think about using DateField :)

Thanks
Bartek

> 
> Jérome
> _______________________________________________
> Erp5-dev mailing list
> Erp5-dev at erp5.org
> http://erp5.org/mailman/listinfo/erp5-dev
> 




More information about the Erp5-dev mailing list