Sorry, maybe, I have explained wrong, I not need not add a searchitem, what I need is that the Flexigrid be built initially querying the database by a hidden parameter that I pass from the template. For example, if I have two Flexigrid and I select a movie(row) from the first, second Flexigrid data could be loaded with the authors of this movie, by the id that javascript pass from the template to controller to build the query.
Thanks. On 24 feb, 10:40, Alessandro Molina <[email protected]> wrote: > On Thu, Feb 24, 2011 at 9:56 AM, raulna <[email protected]> wrote: > > Hi, i'm trying to pass a parameter to filter the data on the grid > > like : > > > @expose('json') > > def fetch(self, page=1, rp=25, sortname='title', sortorder='asc', > > qtype=None, query=None): > > ... > > movies = DBSession.query(Movie).filter_by( ... "PARAMETER" ...) > > .... > > > Then, i don't know how to pass this parameter to the controller from > > the template: > > > ${tmpl_context.grid( ¿¿PARAMETER???? )} > > You should add to the Grid declaration a searchitem (searchitems > parameter on grid construction). > Then it will be passed to your fetch call as the qtype argument with > its content inside the query argument. > > Take a look > athttp://turbogears.org/2.0/docs/main/ToscaWidgets/Cookbook/FlexiGrid.h... -- 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.

