On Jan 18, 2008 12:08 PM, Lukasz Szybalski <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> So I converted my results to a datagrid with sqlalchemy. Is there a way
> to somehow tell datagrid to enable sorting on the results passed to it?
>
> from turbogears.widgets import DataGrid
> myusers_datagrid = DataGrid(fields=[
> ('DisplayedColumnName1', 'LastName'),
> ('DisplayedColumnName2', 'FirstName'),
> ]
>
Try using PaginateDataGrid instead of DataGrid... and @paginate()
decorator, which allows the end user to change the sort columns of
your data.
If you don't want the "paginate" effect at all, and you are using TG
>= 1.0.4b4, you can set limit=0 inside @paginate()... [1]
Cheers,
Roger
[1] - http://trac.turbogears.org/changeset/3824
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---