Thanks for your suggestions! At the moment I'm using a paginated datagrid, but what I'm ending up with is a lot of HTML in the controller, as each of the records in the grid has action buttons on it which must be generated in the controller. Or I'm ending up with pieces of the page stuck in all manner of different templates. Maybe you're suggesting the right path, but it hasn't clicked for me and I'm finding that way to be pretty messy.
So for me, I think this is the ideal approach: Have javascript in the template request a limited set of records (thanks to pagination) from the controller. The javascript (using Templates from Jack Slocum's YUI-EXT library) generates the grid. The javascript won't have to do more than 20 rows at a time, and the code that makes the action buttons for the grid is in the same place as the code that handles those actions. However, the hitch is that when using JSON, I don't have access to the tg object, so I can't get at the pagination information that's contained in there; as far as I can tell. This means I can't make navigation controlls for the paginated data. I'm going to look at the paginate decorator and see if I can modify it to have an option to pass the paginate info alongside the data instead of sticking it in the tg object. But maybe there's something I'm missing. -josh On Feb 28, 3:05 am, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > On 2/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi > > I'm using paginate on a function that's returning JSON data instead of > > passing through a template. Is there a way to access the tg.paginate > > variables among that JSON data? > > Thanks. > > -josh > > well the thing is that the async call shouldn't be that big if you do > need pagination then probably the best way won't be to insert all > those rows into to DOM from javascript. > > did you check out turbogears.widgets.AjaxGrid? I believe it is doing > what you need. > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

