Hi all,
I'm (trying to) develop an enhanced version of DataGrid, merging different
features:
- paging (from PaginateDataGrid and paginate decorator)
- record management (from TGFastData)
- ajax refresh (inspired on WhatWhat code project)
Fromnow all works great except ajax refresh.
To do this feature I need mix 2 decorators:
@expose(fragment=True)
@paginate("data")
but, if I return widget rendering code then doesn't works paginate and if I
return one dict with my widget and my data then doesn't work ajax.
To solve this situation I need return two blocks of data:
- one dict for @paginate (in my case, dict(grid=grid, data=data))
- XHTML code for @expose (in my case, grid.render(data))
Someone knows if this it's posible or I need change of mind?
Regards,
Jose
---
This is my controller:
class Customers(object):
def index(self):
pass
@expose(fragment=True)
@paginate("data")
def list(self):
from courier.widgets.datagrid2g.widgets import DataGrid2G
grid = DataGrid2G(
fields=[
PaginateDataGrid.Column("name" , getter=lambda row:
row[1], title="Name" , options=dict(sortable=False),),
PaginateDataGrid.Column("surname1", getter=lambda row:
row[2], title="Surname", options=dict(sortable=False),),
PaginateDataGrid.Column('"id" , getter=lambda
row: row[0], title="ID" , options=dict(sortable=False),),
],
)
data = customers.select()
return grid.render(data)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---