> > Is it possible to have more than one widget, representing more than
> > one
> > column? What is a way to have this?
>
> Sure, just pass the needed func/widget as the tuple's second argument
> for each column you need:
>
> fields [
> ('Name', name_widget),
> ('Age', age_widget),
> ....
> ]
I tried this:
name_widget = TextField('name')
age_widget = TextField('age')
sortable_person_list = PaginateDataGrid(
fields=[
PaginateDataGrid.Column('name', name_widget, 'Name',
options=dict(sortable=True)),
PaginateDataGrid.Column('age', age_widget, 'Age',
options=dict(sortable=True,
reverse_order=True)),
])
As suggested, I had added this function to the person class:
def __str__(self):
return self.name
But then, both columns show the name only! Because, I guess, both get a
person object and show whatever the __str__ method returns.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---